pub struct PublicKeyInfo<'a> { /* private fields */ }Expand description
A public key and the algorithm it belongs to.
Implementations§
Source§impl<'a> PublicKeyInfo<'a>
impl<'a> PublicKeyInfo<'a>
Sourcepub fn algorithm(self) -> AlgorithmIdentifier<'a>
pub fn algorithm(self) -> AlgorithmIdentifier<'a>
Which algorithm this key belongs to.
Sourcepub fn key_octets(self) -> Option<&'a [u8]>
pub fn key_octets(self) -> Option<&'a [u8]>
The key bytes, where the key is a whole number of octets, which it is for every algorithm a certificate carries.
Sourcepub fn key_offset(self) -> u64
pub fn key_offset(self) -> u64
Where the first key octet sits in the whole document.
Sourcepub fn as_bytes(self) -> &'a [u8] ⓘ
pub fn as_bytes(self) -> &'a [u8] ⓘ
The whole structure as it was encoded.
What a fingerprint over the key information is taken of. The key
identifier the profile describes is a digest of Self::key_octets
instead, and the two are different values over different bytes.
Sourcepub fn read_element(
parent: &Reader<'a>,
element: &Element<'a>,
field: &'static str,
) -> Result<PublicKeyInfo<'a>>
pub fn read_element( parent: &Reader<'a>, element: &Element<'a>, field: &'static str, ) -> Result<PublicKeyInfo<'a>>
Reads SPKI from an element in the caller’s reader, retaining its budget.
The structure follows RFC 5280 section 4.1.2.7: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.1.2.7. Algorithm-specific restrictions belong to the cryptographic consumer. No key bytes are copied or re-encoded, and no new parser budget is created.
§Errors
Reports malformed structure, trailing fields or an exhausted parent budget.