Expand description
§RustCrypto: X.509 Subject Public Key Info (SPKI)
X.509 Subject Public Key Info types describing public keys as well as their associated AlgorithmIdentifiers (i.e. OIDs).
Specified in RFC 5280 § 4.1.
§Minimum Supported Rust Version
This crate requires Rust 1.65 at a minimum.
We may change the MSRV in the future, but it will be accompanied by a minor version bump.
§License
Licensed under either of:
at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
§Usage
The following example demonstrates how to use an OID as the parameters
of an AlgorithmIdentifier.
Borrow the ObjectIdentifier first then use der::AnyRef::from or .into():
use spki::{AlgorithmIdentifier, ObjectIdentifier};
let alg_oid = "1.2.840.10045.2.1".parse::<ObjectIdentifier>().unwrap();
let params_oid = "1.2.840.10045.3.1.7".parse::<ObjectIdentifier>().unwrap();
let alg_id = AlgorithmIdentifier {
oid: alg_oid,
parameters: Some(params_oid)
};Re-exports§
pub use der;
Structs§
- X.509
AlgorithmIdentifieras defined in RFC 5280 Section 4.1.1.2. - ASN.1 DER-encoded document.
- Object identifier (OID).
- X.509
SubjectPublicKeyInfo(SPKI) as defined in RFC 5280 § 4.1.2.7.
Enums§
- Error type
Traits§
- Returns
AlgorithmIdentifierassociated with the structure. - Parse a public key object from an encoded SPKI document.
- Returns
AlgorithmIdentifierassociated with the structure. - Returns
AlgorithmIdentifierassociated with the signature system. - Serialize a public key object to a SPKI-encoded document.
- Returns
AlgorithmIdentifierassociated with the signature system. - Returns the
BitStringencoding of the signature.
Type Aliases§
AlgorithmIdentifierreference which hasAnyparameters.AlgorithmIdentifierreference which hasAnyRefparameters.AlgorithmIdentifierwithObjectIdentifierparameters.- Result type with
spkicrate’sErrortype.