Skip to main content

HostMacKey

Trait HostMacKey 

Source
pub trait HostMacKey: Send {
    // Required methods
    fn algorithm_name(&mut self, self_: Resource<MacKey>) -> Result<String>;
    fn algorithm_hash(
        &mut self,
        self_: Resource<MacKey>,
    ) -> Result<Option<String>>;
    fn algorithm_length(&mut self, self_: Resource<MacKey>) -> Result<u32>;
    fn extractable(&mut self, self_: Resource<MacKey>) -> Result<bool>;
    fn can_sign(&mut self, self_: Resource<MacKey>) -> Result<bool>;
    fn can_verify(&mut self, self_: Resource<MacKey>) -> Result<bool>;
}

Required Methods§

Source

fn algorithm_name(&mut self, self_: Resource<MacKey>) -> Result<String>

The registry name of the algorithm family this key is bound to, e.g. "HMAC" (WebCrypto’s KeyAlgorithm.name). The algorithm’s parameters are separate getters (algorithm-hash, algorithm-length), so future parameters are new getters rather than changes to a shared type.

Source

fn algorithm_hash(&mut self, self_: Resource<MacKey>) -> Result<Option<String>>

The registry name of the digest this key’s algorithm is parameterized over, if any: e.g. "SHA-256" for HMAC-SHA-256 (WebCrypto’s HmacKeyAlgorithm.hash). none for MAC algorithms not built on a digest.

Source

fn algorithm_length(&mut self, self_: Resource<MacKey>) -> Result<u32>

The key length in bits (WebCrypto’s HmacKeyAlgorithm.length).

Source

fn extractable(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether the key material may be exported.

Source

fn can_sign(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether this key permits sign. A refused operation fails error.not-permitted.

Source

fn can_verify(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether this key permits verify. See can-sign.

Implementations on Foreign Types§

Source§

impl<_T: HostMacKey + ?Sized + Send> HostMacKey for &mut _T

Source§

fn algorithm_name(&mut self, self_: Resource<MacKey>) -> Result<String>

The registry name of the algorithm family this key is bound to, e.g. "HMAC" (WebCrypto’s KeyAlgorithm.name). The algorithm’s parameters are separate getters (algorithm-hash, algorithm-length), so future parameters are new getters rather than changes to a shared type.

Source§

fn algorithm_hash(&mut self, self_: Resource<MacKey>) -> Result<Option<String>>

The registry name of the digest this key’s algorithm is parameterized over, if any: e.g. "SHA-256" for HMAC-SHA-256 (WebCrypto’s HmacKeyAlgorithm.hash). none for MAC algorithms not built on a digest.

Source§

fn algorithm_length(&mut self, self_: Resource<MacKey>) -> Result<u32>

The key length in bits (WebCrypto’s HmacKeyAlgorithm.length).

Source§

fn extractable(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether the key material may be exported.

Source§

fn can_sign(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether this key permits sign. A refused operation fails error.not-permitted.

Source§

fn can_verify(&mut self, self_: Resource<MacKey>) -> Result<bool>

Whether this key permits verify. See can-sign.

Implementors§