Skip to content

Commit

Permalink
Add more backward-compatibility aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed May 7, 2021
1 parent 5060c2b commit 5d5c710
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ include = [
"src/signed_data.rs",
"src/time.rs",
"src/trust_anchor.rs",
"src/trust_anchor_util.rs",
"src/verify_cert.rs",
"src/lib.rs",

Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ mod name;
mod signed_data;
mod time;
mod trust_anchor;
pub mod trust_anchor_util;

mod verify_cert;

Expand Down Expand Up @@ -76,6 +77,10 @@ pub type DNSName = DnsName;
#[allow(missing_docs, unknown_lints, clippy::upper_case_acronyms)]
pub type DNSNameRef<'a> = DnsNameRef<'a>;

#[deprecated(note = "use InvalidDnsNameError")]
#[allow(missing_docs, unknown_lints, clippy::upper_case_acronyms)]
pub type InvalidDNSNameError = InvalidDnsNameError;

#[deprecated(note = "use TlsServerTrustAnchors")]
#[allow(missing_docs, unknown_lints, clippy::upper_case_acronyms)]
pub type TLSServerTrustAnchors<'a> = TlsServerTrustAnchors<'a>;
Expand Down
23 changes: 23 additions & 0 deletions src/trust_anchor_util.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2015-2021 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

//! Deprecated. Use `TrustAnchor`.
use crate::{Error, TrustAnchor};

/// Deprecated. Use TrustAnchor::try_from_cert_der.
#[deprecated(note = "Use TrustAnchor::try_from_cert_der")]
pub fn cert_der_as_trust_anchor(cert_der: &[u8]) -> Result<TrustAnchor, Error> {
TrustAnchor::try_from_cert_der(cert_der)
}

0 comments on commit 5d5c710

Please sign in to comment.