pub enum HashAlgorithm {
Sha1,
Sha256,
}Expand description
The hash algorithm used for a PKL asset digest.
Per SMPTE ST 2067-2:2020 §9, SHA-1 is the default algorithm.
SHA-256 is supported via the <HashAlgorithm> element using
XML Digital Signature algorithm URIs.
Variants§
Sha1
SHA-1 (default per ST 2067-2 §9).
URI: http://www.w3.org/2000/09/xmldsig#sha1
Sha256
SHA-256.
URI: http://www.w3.org/2001/04/xmlenc#sha256
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn from_uri(uri: &str) -> Option<Self>
pub fn from_uri(uri: &str) -> Option<Self>
Parse a hash algorithm from an XML Digital Signature algorithm URI.
Per ST 2067-2:2020 §9, the <HashAlgorithm> element uses
ds:DigestMethodType which carries an Algorithm attribute URI.
Sourcepub fn digest_len(&self) -> usize
pub fn digest_len(&self) -> usize
Expected digest length in bytes for this algorithm.
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
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 moreimpl Copy for HashAlgorithm
Source§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
Source§impl<'de> Deserialize<'de> for HashAlgorithm
impl<'de> Deserialize<'de> for HashAlgorithm
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 Display for HashAlgorithm
impl Display for HashAlgorithm
impl Eq for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§fn eq(&self, other: &HashAlgorithm) -> bool
fn eq(&self, other: &HashAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HashAlgorithm
impl Serialize for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnsafeUnpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
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