Skip to main content

HostCipherKey

Trait HostCipherKey 

Source
pub trait HostCipherKey: Send {
    // Required methods
    fn algorithm_name(&mut self, self_: Resource<CipherKey>) -> Result<String>;
    fn algorithm_length(&mut self, self_: Resource<CipherKey>) -> Result<u32>;
    fn iv_size(&mut self, self_: Resource<CipherKey>) -> Result<u32>;
    fn extractable(&mut self, self_: Resource<CipherKey>) -> Result<bool>;
    fn can_encrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>;
    fn can_decrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>;
    fn can_wrap(&mut self, self_: Resource<CipherKey>) -> Result<bool>;
    fn can_unwrap(&mut self, self_: Resource<CipherKey>) -> Result<bool>;
}

Required Methods§

Source

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

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

Source

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

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

Source

fn iv_size(&mut self, self_: Resource<CipherKey>) -> Result<u32>

The algorithm’s IV size in bytes, e.g. 16 for the AES modes (the CBC IV, or the CTR initial counter block). encrypt and decrypt accept exactly this length.

Source

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

Whether the key material may be exported.

Source

fn can_encrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>

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

Source

fn can_decrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>

Whether this key permits decrypt. See can-encrypt.

Source

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

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

Source

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

Whether this key permits unwrap. See can-wrap.

Implementations on Foreign Types§

Source§

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

Source§

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

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

Source§

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

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

Source§

fn iv_size(&mut self, self_: Resource<CipherKey>) -> Result<u32>

The algorithm’s IV size in bytes, e.g. 16 for the AES modes (the CBC IV, or the CTR initial counter block). encrypt and decrypt accept exactly this length.

Source§

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

Whether the key material may be exported.

Source§

fn can_encrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>

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

Source§

fn can_decrypt(&mut self, self_: Resource<CipherKey>) -> Result<bool>

Whether this key permits decrypt. See can-encrypt.

Source§

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

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

Source§

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

Whether this key permits unwrap. See can-wrap.

Implementors§