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: KeyPublic key data
Implementations§
Source§impl SubjectPublicKeyInfo<Any, BitString>
impl SubjectPublicKeyInfo<Any, BitString>
Sourcepub fn from_key<T>(
source: T,
) -> Result<SubjectPublicKeyInfo<Any, BitString>, Error>where
T: EncodePublicKey,
pub fn from_key<T>(
source: T,
) -> Result<SubjectPublicKeyInfo<Any, BitString>, Error>where
T: EncodePublicKey,
Create a SubjectPublicKeyInfoOwned from any object that implements
EncodePublicKey.
Trait Implementations§
Source§impl<Params, Key> Clone for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> Clone for SubjectPublicKeyInfo<Params, Key>
Source§fn clone(&self) -> SubjectPublicKeyInfo<Params, Key>
fn clone(&self) -> SubjectPublicKeyInfo<Params, Key>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Params, Key> Debug for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> Debug for SubjectPublicKeyInfo<Params, Key>
Source§impl<'a, 'k, Params, Key> DecodeValue<'a> for SubjectPublicKeyInfo<Params, Key>where
'a: 'k,
Key: 'k + Decode<'a>,
Params: Choice<'a> + Encode,
impl<'a, 'k, Params, Key> DecodeValue<'a> for SubjectPublicKeyInfo<Params, Key>where
'a: 'k,
Key: 'k + Decode<'a>,
Params: Choice<'a> + Encode,
Source§fn decode_value<R>(
reader: &mut R,
header: Header,
) -> Result<SubjectPublicKeyInfo<Params, Key>, Error>where
R: Reader<'a>,
fn decode_value<R>(
reader: &mut R,
header: Header,
) -> Result<SubjectPublicKeyInfo<Params, Key>, Error>where
R: Reader<'a>,
Attempt to decode this message using the provided [
Reader].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 OwnedToRef for SubjectPublicKeyInfo<Any, BitString>
impl OwnedToRef for SubjectPublicKeyInfo<Any, BitString>
Source§type Borrowed<'a> = SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>>
type Borrowed<'a> = SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>>
The resulting type referencing back to Self
Source§fn owned_to_ref(
&self,
) -> <SubjectPublicKeyInfo<Any, BitString> as OwnedToRef>::Borrowed<'_>
fn owned_to_ref( &self, ) -> <SubjectPublicKeyInfo<Any, BitString> as OwnedToRef>::Borrowed<'_>
Creates a new object referencing back to the self for storage
Source§impl<Params, Key> PartialEq for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> PartialEq for SubjectPublicKeyInfo<Params, Key>
Source§fn eq(&self, other: &SubjectPublicKeyInfo<Params, Key>) -> bool
fn eq(&self, other: &SubjectPublicKeyInfo<Params, Key>) -> bool
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> RefToOwned<'a> for SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>>
impl<'a> RefToOwned<'a> for SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>>
Source§type Owned = SubjectPublicKeyInfo<Any, BitString>
type Owned = SubjectPublicKeyInfo<Any, BitString>
The resulting type after obtaining ownership.
Source§fn ref_to_owned(
&self,
) -> <SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>> as RefToOwned<'a>>::Owned
fn ref_to_owned( &self, ) -> <SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>> as RefToOwned<'a>>::Owned
Creates a new object taking ownership of the data
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, Params, Key> TryFrom<&SubjectPublicKeyInfo<Params, Key>> for Document
Available on crate feature alloc only.
impl<'a, 'k, Params, Key> TryFrom<&SubjectPublicKeyInfo<Params, Key>> for Document
Available on crate feature
alloc only.Source§impl<'a, 'k, Params, Key> TryFrom<SubjectPublicKeyInfo<Params, Key>> for Document
Available on crate feature alloc only.
impl<'a, 'k, Params, Key> TryFrom<SubjectPublicKeyInfo<Params, Key>> for Document
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, Key> 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> StructuralPartialEq for SubjectPublicKeyInfo<Params, Key>
Auto Trait Implementations§
impl<Params, Key> Freeze for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> RefUnwindSafe for SubjectPublicKeyInfo<Params, Key>where
Key: RefUnwindSafe,
Params: RefUnwindSafe,
impl<Params, Key> Send for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> Sync for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> Unpin for SubjectPublicKeyInfo<Params, Key>
impl<Params, Key> UnsafeUnpin for SubjectPublicKeyInfo<Params, Key>where
Key: UnsafeUnpin,
Params: UnsafeUnpin,
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
§impl<'a, T> Choice<'a> for Twhere
T: Decode<'a> + FixedTag,
impl<'a, T> Choice<'a> for Twhere
T: Decode<'a> + FixedTag,
§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided [
Tag] decodable as a variant of this CHOICE?Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
§impl<T> DecodePem for Twhere
T: DecodeOwned + PemLabel,
impl<T> DecodePem for Twhere
T: DecodeOwned + PemLabel,
§impl<T> DerOrd for Twhere
T: EncodeValue + ValueOrd + Tagged,
impl<T> DerOrd for Twhere
T: EncodeValue + ValueOrd + Tagged,
§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
§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.
§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].
§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.
§fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
Encode this message as ASN.1 DER, appending it to the provided
byte vector.
§impl<T> EncodePem for Twhere
T: Encode + PemLabel,
impl<T> EncodePem for Twhere
T: Encode + PemLabel,
§fn to_pem(&self, line_ending: LineEnding) -> Result<String, Error>
fn to_pem(&self, line_ending: LineEnding) -> Result<String, Error>
Try to encode this type as PEM.