Skip to main content

HostAeadKey

Trait HostAeadKey 

Source
pub trait HostAeadKey: Send {
    // Required methods
    fn algorithm_name(&mut self, self_: Resource<AeadKey>) -> Result<String>;
    fn algorithm_length(&mut self, self_: Resource<AeadKey>) -> Result<u32>;
    fn nonce_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>;
    fn tag_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>;
    fn extractable(&mut self, self_: Resource<AeadKey>) -> Result<bool>;
    fn can_seal(&mut self, self_: Resource<AeadKey>) -> Result<bool>;
    fn can_open(&mut self, self_: Resource<AeadKey>) -> Result<bool>;
    fn can_wrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>;
    fn can_unwrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>;
}

Required Methods§

Source

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

The registry name of the algorithm family this key is bound to, e.g. "AES-GCM" (WebCrypto’s KeyAlgorithm.name). Parameters are separate getters, as for mac-key.algorithm-name.

Source

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

The key length in bits, e.g. 256 for AES-256-GCM (WebCrypto’s AesKeyAlgorithm.length).

Source

fn nonce_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>

The algorithm’s standard nonce size in bytes, e.g. 12 for AES-GCM. This key’s seal/open always accept it, so a component granted only the key handle can construct nonces without matching on algorithm-name. Whether other lengths are accepted is the algorithm’s contract, documented by its minting interface.

Source

fn tag_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>

The algorithm’s default tag size in bytes, e.g. 16: what a tag-size of none selects, and the framing arithmetic for default-tag messages (sealed length = plaintext length + tag-size).

Source

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

Whether the key material may be exported.

Source

fn can_seal(&mut self, self_: Resource<AeadKey>) -> Result<bool>

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

Source

fn can_open(&mut self, self_: Resource<AeadKey>) -> Result<bool>

Whether this key permits open. See can-seal.

Source

fn can_wrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>

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

Source

fn can_unwrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>

Whether this key permits unwrap. See can-wrap.

Implementations on Foreign Types§

Source§

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

Source§

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

The registry name of the algorithm family this key is bound to, e.g. "AES-GCM" (WebCrypto’s KeyAlgorithm.name). Parameters are separate getters, as for mac-key.algorithm-name.

Source§

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

The key length in bits, e.g. 256 for AES-256-GCM (WebCrypto’s AesKeyAlgorithm.length).

Source§

fn nonce_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>

The algorithm’s standard nonce size in bytes, e.g. 12 for AES-GCM. This key’s seal/open always accept it, so a component granted only the key handle can construct nonces without matching on algorithm-name. Whether other lengths are accepted is the algorithm’s contract, documented by its minting interface.

Source§

fn tag_size(&mut self, self_: Resource<AeadKey>) -> Result<u32>

The algorithm’s default tag size in bytes, e.g. 16: what a tag-size of none selects, and the framing arithmetic for default-tag messages (sealed length = plaintext length + tag-size).

Source§

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

Whether the key material may be exported.

Source§

fn can_seal(&mut self, self_: Resource<AeadKey>) -> Result<bool>

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

Source§

fn can_open(&mut self, self_: Resource<AeadKey>) -> Result<bool>

Whether this key permits open. See can-seal.

Source§

fn can_wrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>

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

Source§

fn can_unwrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>

Whether this key permits unwrap. See can-wrap.

Implementors§