pub struct TrustList { /* private fields */ }Expand description
Struct used to index all the available public keys which can be used to validate the signature on a given certificate.
Keys are indexed by their kid (Key ID) which is an arbitrary sequence of bytes.
Implementations§
Source§impl TrustList
impl TrustList
Sourcepub fn get_key(&self, kid: &[u8]) -> Option<&[u8]>
pub fn get_key(&self, kid: &[u8]) -> Option<&[u8]>
Returns the public key with the specified key identifier or
None if there is no key with that key ID.
Sourcepub fn add_key_from_certificate(
&mut self,
base64_x509_cert: &str,
) -> Result<(), KeyParseError>
pub fn add_key_from_certificate( &mut self, base64_x509_cert: &str, ) -> Result<(), KeyParseError>
Adds a public key from a X509 certificate encoded in Base64 (certificate data only, without delimiters). When using a certificate the KID are the first 8 bytes of the SHA256 hash of the certificate data (source).
Sourcepub fn add_key_from_base64(
&mut self,
kid: &[u8],
base64_key: &str,
) -> Result<(), KeyParseError>
pub fn add_key_from_base64( &mut self, kid: &[u8], base64_key: &str, ) -> Result<(), KeyParseError>
Adds a base64 encoded raw key with the specified kid to the trust list
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrustList
impl RefUnwindSafe for TrustList
impl Send for TrustList
impl Sync for TrustList
impl Unpin for TrustList
impl UnwindSafe for TrustList
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