pub struct CertificateHash {
pub algorithm: CertHashAlgorithm,
pub hash_value: Vec<u8>,
}Expand description
X.509 certificate hash (COSE_CertHash).
Contains the hash algorithm and the hash value of a certificate. Used with the x5t (label 34) header parameter.
Fields§
§algorithm: CertHashAlgorithmHash algorithm identifier
hash_value: Vec<u8>Hash value (raw bytes, serialized as base64 in JSON)
Implementations§
Source§impl CertificateHash
impl CertificateHash
Sourcepub fn validate_length(&self) -> bool
pub fn validate_length(&self) -> bool
Validate that the hash value length matches the expected length for known algorithms.
Returns true if the hash length is correct for the algorithm, or if the
algorithm is unknown (in which case no validation is performed).
Returns false if the length does not match a known algorithm’s expected output.
Trait Implementations§
Source§impl Clone for CertificateHash
impl Clone for CertificateHash
Source§fn clone(&self) -> CertificateHash
fn clone(&self) -> CertificateHash
Returns a duplicate 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 Debug for CertificateHash
impl Debug for CertificateHash
Source§impl Default for CertificateHash
impl Default for CertificateHash
Source§fn default() -> CertificateHash
fn default() -> CertificateHash
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CertificateHash
impl<'de> Deserialize<'de> for CertificateHash
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CertificateHash
impl PartialEq for CertificateHash
Source§impl Serialize for CertificateHash
impl Serialize for CertificateHash
impl Eq for CertificateHash
impl StructuralPartialEq for CertificateHash
Auto Trait Implementations§
impl Freeze for CertificateHash
impl RefUnwindSafe for CertificateHash
impl Send for CertificateHash
impl Sync for CertificateHash
impl Unpin for CertificateHash
impl UnwindSafe for CertificateHash
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