Struct spki::SubjectPublicKeyInfo
source · pub struct SubjectPublicKeyInfo<Params, Key> {
pub algorithm: AlgorithmIdentifier<Params>,
pub subject_public_key: Key,
}
Expand description
X.509 SubjectPublicKeyInfo
(SPKI) as defined in RFC 5280 § 4.1.2.7.
ASN.1 structure containing an AlgorithmIdentifier
and public key
data in an algorithm specific format.
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
Fields§
§algorithm: AlgorithmIdentifier<Params>
X.509 AlgorithmIdentifier
for the public key type
subject_public_key: Key
Public key data
Implementations§
source§impl SubjectPublicKeyInfo<Any, BitString>
impl SubjectPublicKeyInfo<Any, BitString>
sourcepub fn from_key<T>(source: T) -> Result<Self>where
T: EncodePublicKey,
Available on crate feature alloc
only.
pub fn from_key<T>(source: T) -> Result<Self>where T: EncodePublicKey,
alloc
only.Create a SubjectPublicKeyInfoOwned
from any object that implements
EncodePublicKey
.
source§impl<'a, Params, Key> SubjectPublicKeyInfo<Params, Key>where
Params: Choice<'a> + Encode,
Key: Decode<'a> + Encode + FixedTag,
impl<'a, Params, Key> SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + Encode, Key: Decode<'a> + Encode + FixedTag,
sourcepub fn fingerprint_base64(&self) -> Result<String>
Available on crate features fingerprint
and alloc
and base64
only.
pub fn fingerprint_base64(&self) -> Result<String>
fingerprint
and alloc
and base64
only.Calculate the SHA-256 fingerprint of this SubjectPublicKeyInfo
and
encode it as a Base64 string.
See RFC7469 § 2.1.1 for more information.
sourcepub fn fingerprint_bytes(&self) -> Result<FingerprintBytes>
Available on crate feature fingerprint
only.
pub fn fingerprint_bytes(&self) -> Result<FingerprintBytes>
fingerprint
only.Calculate the SHA-256 fingerprint of this SubjectPublicKeyInfo
as
a raw byte array.
See RFC7469 § 2.1.1 for more information.
Trait Implementations§
source§impl<'arbitrary, Params: Arbitrary<'arbitrary>, Key: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for SubjectPublicKeyInfo<Params, Key>
impl<'arbitrary, Params: Arbitrary<'arbitrary>, Key: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for SubjectPublicKeyInfo<Params, Key>
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl<Params: Clone, Key: Clone> Clone for SubjectPublicKeyInfo<Params, Key>
impl<Params: Clone, Key: Clone> Clone for SubjectPublicKeyInfo<Params, Key>
source§fn clone(&self) -> SubjectPublicKeyInfo<Params, Key>
fn clone(&self) -> SubjectPublicKeyInfo<Params, Key>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a: 'k, 'k, Params, Key> DecodeValue<'a> for SubjectPublicKeyInfo<Params, Key>where
Params: Choice<'a> + Encode,
Key: Decode<'a> + 'k,
impl<'a: 'k, 'k, Params, Key> DecodeValue<'a> for SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + Encode, Key: Decode<'a> + 'k,
source§impl<'a, Params, Key> EncodeValue for SubjectPublicKeyInfo<Params, Key>where
Params: Choice<'a> + Encode,
Key: Encode,
impl<'a, Params, Key> EncodeValue for SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + Encode, Key: Encode,
source§impl<Params: PartialEq, Key: PartialEq> PartialEq for SubjectPublicKeyInfo<Params, Key>
impl<Params: PartialEq, Key: PartialEq> PartialEq for SubjectPublicKeyInfo<Params, Key>
source§fn eq(&self, other: &SubjectPublicKeyInfo<Params, Key>) -> bool
fn eq(&self, other: &SubjectPublicKeyInfo<Params, Key>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Params, Key> PemLabel for SubjectPublicKeyInfo<Params, Key>
Available on crate feature pem
only.
impl<Params, Key> PemLabel for SubjectPublicKeyInfo<Params, Key>
Available on crate feature
pem
only.source§impl<'a, Params, Key> TryFrom<&'a [u8]> for SubjectPublicKeyInfo<Params, Key>where
Params: Choice<'a> + Encode,
Key: Decode<'a> + Encode + FixedTag,
impl<'a, Params, Key> TryFrom<&'a [u8]> for SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + Encode, Key: Decode<'a> + Encode + FixedTag,
source§impl<'a: 'k, 'k, Params, Key> TryFrom<&SubjectPublicKeyInfo<Params, Key>> for Documentwhere
Params: Choice<'a> + Encode,
Key: Decode<'a> + Encode + FixedTag + 'k,
BitStringRef<'a>: From<&'k Key>,
Available on crate feature alloc
only.
impl<'a: 'k, 'k, Params, Key> TryFrom<&SubjectPublicKeyInfo<Params, Key>> for Documentwhere Params: Choice<'a> + Encode, Key: Decode<'a> + Encode + FixedTag + 'k, BitStringRef<'a>: From<&'k Key>,
Available on crate feature
alloc
only.source§impl<'a: 'k, 'k, Params, Key> TryFrom<SubjectPublicKeyInfo<Params, Key>> for Documentwhere
Params: Choice<'a> + Encode,
Key: Decode<'a> + Encode + FixedTag + 'k,
BitStringRef<'a>: From<&'k Key>,
Available on crate feature alloc
only.
impl<'a: 'k, 'k, Params, Key> TryFrom<SubjectPublicKeyInfo<Params, Key>> for Documentwhere Params: Choice<'a> + Encode, Key: Decode<'a> + Encode + FixedTag + 'k, BitStringRef<'a>: From<&'k Key>,
Available on crate feature
alloc
only.source§impl<'a, Params, Key> ValueOrd for SubjectPublicKeyInfo<Params, Key>where
Params: Choice<'a> + DerOrd + Encode,
Key: ValueOrd,
impl<'a, Params, Key> ValueOrd for SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + DerOrd + Encode, Key: ValueOrd,
impl<Params: Eq, Key: Eq> Eq for SubjectPublicKeyInfo<Params, Key>
impl<'a, Params, Key> Sequence<'a> for SubjectPublicKeyInfo<Params, Key>where Params: Choice<'a> + Encode, Key: Decode<'a> + Encode + FixedTag,
impl<Params, Key> StructuralEq for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> StructuralPartialEq for SubjectPublicKeyInfo<Params, Key>
Auto Trait Implementations§
impl<Params, Key> RefUnwindSafe for SubjectPublicKeyInfo<Params, Key>where Key: RefUnwindSafe, Params: RefUnwindSafe,
impl<Params, Key> Send for SubjectPublicKeyInfo<Params, Key>where Key: Send, Params: Send,
impl<Params, Key> Sync for SubjectPublicKeyInfo<Params, Key>where Key: Sync, Params: Sync,
impl<Params, Key> Unpin for SubjectPublicKeyInfo<Params, Key>where Key: Unpin, Params: Unpin,
impl<Params, Key> UnwindSafe for SubjectPublicKeyInfo<Params, Key>where Key: UnwindSafe, Params: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere T: DecodeValue<'a> + FixedTag,
source§impl<T> DecodePem for Twhere
T: DecodeOwned + PemLabel,
impl<T> DecodePem for Twhere T: DecodeOwned + PemLabel,
source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere T: EncodeValue + Tagged,
source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.