pub struct WasiWebcryptoCtxView<'a> {
pub ctx: &'a mut WasiWebcryptoCtx,
pub table: &'a mut ResourceTable,
}Expand description
A borrowed view into a host’s WasiWebcryptoCtx and its
[ResourceTable].
Returned by WasiWebcryptoView::webcrypto, this is the [HasData::Data]
the generated host bindings operate on.
Fields§
§ctx: &'a mut WasiWebcryptoCtxMutable reference to the WebCrypto host context.
table: &'a mut ResourceTableMutable reference to the table used to manage host resources.
Trait Implementations§
Source§impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
Source§fn make_digest(
&mut self,
variant: Sha2Variant,
) -> Result<Result<Resource<Digest>, Error>>
fn make_digest( &mut self, variant: Sha2Variant, ) -> Result<Result<Resource<Digest>, Error>>
A
digest bound to the declared SHA-2 variant. Fails with
error.unsupported if this implementation does not serve the
variant.Source§impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
Source§fn make_rejecting_digest(&mut self) -> Result<Result<Resource<Digest>, Error>>
fn make_rejecting_digest(&mut self) -> Result<Result<Resource<Digest>, Error>>
Mint a SHA-1 digest that rejects on a detected collision attack:
compute fails with error.extension — origin "polymorph:webcrypto",
name "collision-detected" — for input carrying an attack
pattern, and returns the standard SHA-1 digest for everything
else. Choose this posture to surface an attack as a diagnosable
error.Source§fn make_mitigating_digest(&mut self) -> Result<Result<Resource<Digest>, Error>>
fn make_mitigating_digest(&mut self) -> Result<Result<Resource<Digest>, Error>>
Mint a SHA-1 digest that mitigates a detected collision attack:
for input carrying an attack pattern,
compute returns the
sha1dc safe hash — a deterministic hardened variant the attack was
not engineered against — and the standard SHA-1 digest for
everything else. Two parties hashing the same attacked input agree
on its safe hash, so pipelines keep flowing while the colliding
pair no longer collides. Choose this posture for content
addressing, where an error would wedge the pipeline; the cost is
that an attack surfaces as an external hash mismatch rather than a
named error.Source§impl HostAeadKey for WasiWebcryptoCtxView<'_>
impl HostAeadKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<AeadKey>) -> Result<String>
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>
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>
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>
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>
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>
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>
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>
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>
fn can_unwrap(&mut self, self_: Resource<AeadKey>) -> Result<bool>
Whether this key permits
unwrap. See can-wrap.Source§impl HostAeadKeyOptions for WasiWebcryptoCtxView<'_>
impl HostAeadKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<AeadKeyOptions>>
Source§fn can_seal(
&mut self,
self_: Resource<AeadKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_seal( &mut self, self_: Resource<AeadKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
seal. Disabled by default.Source§fn can_open(
&mut self,
self_: Resource<AeadKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_open( &mut self, self_: Resource<AeadKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
open. Disabled by default.Source§fn can_wrap(
&mut self,
self_: Resource<AeadKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_wrap( &mut self, self_: Resource<AeadKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
wrap key material. Disabled by
default.Source§fn can_unwrap(
&mut self,
self_: Resource<AeadKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_unwrap( &mut self, self_: Resource<AeadKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
unwrap key material (see
can-wrap). Disabled by default.Source§fn extractable(
&mut self,
self_: Resource<AeadKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<AeadKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported. Disabled by
default.
Source§impl HostAgreementKeyOptions for WasiWebcryptoCtxView<'_>
impl HostAgreementKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<AgreementKeyOptions>>
Source§fn can_derive_bits(
&mut self,
self_: Resource<AgreementKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_derive_bits( &mut self, self_: Resource<AgreementKeyOptions>, allowed: bool, ) -> Result<()>
Whether inputs agreed by the minted key may yield raw bits.
Disabled by default.
Source§fn can_derive_key(
&mut self,
self_: Resource<AgreementKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_derive_key( &mut self, self_: Resource<AgreementKeyOptions>, allowed: bool, ) -> Result<()>
Whether inputs agreed by the minted key may mint keys. Disabled
by default.
Source§fn extractable(
&mut self,
self_: Resource<AgreementKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<AgreementKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported
(
secret-key.export-key-jwk/-pkcs8). Disabled by default.Source§impl HostCipherKey for WasiWebcryptoCtxView<'_>
impl HostCipherKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<CipherKey>) -> Result<String>
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>
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>
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>
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>
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>
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>
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>
fn can_unwrap(&mut self, self_: Resource<CipherKey>) -> Result<bool>
Whether this key permits
unwrap. See can-wrap.Source§impl HostCipherKeyOptions for WasiWebcryptoCtxView<'_>
impl HostCipherKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<CipherKeyOptions>>
Source§fn can_encrypt(
&mut self,
self_: Resource<CipherKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_encrypt( &mut self, self_: Resource<CipherKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
encrypt. Disabled by default.Source§fn can_decrypt(
&mut self,
self_: Resource<CipherKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_decrypt( &mut self, self_: Resource<CipherKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
decrypt. Disabled by default.Source§fn can_wrap(
&mut self,
self_: Resource<CipherKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_wrap( &mut self, self_: Resource<CipherKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
wrap key material. Disabled by
default.Source§fn can_unwrap(
&mut self,
self_: Resource<CipherKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_unwrap( &mut self, self_: Resource<CipherKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
unwrap key material (see
can-wrap). Disabled by default.Source§fn extractable(
&mut self,
self_: Resource<CipherKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<CipherKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported. Disabled by
default.
Source§impl HostDecryptionKey for WasiWebcryptoCtxView<'_>
impl HostDecryptionKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<DecryptionKey>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<DecryptionKey>) -> Result<String>
See
encryption-key.algorithm-name.Source§fn algorithm_hash(
&mut self,
self_: Resource<DecryptionKey>,
) -> Result<Option<String>>
fn algorithm_hash( &mut self, self_: Resource<DecryptionKey>, ) -> Result<Option<String>>
See
encryption-key.algorithm-hash.Source§fn algorithm_length(
&mut self,
self_: Resource<DecryptionKey>,
) -> Result<Option<u32>>
fn algorithm_length( &mut self, self_: Resource<DecryptionKey>, ) -> Result<Option<u32>>
See
encryption-key.algorithm-length.Source§fn algorithm_public_exponent(
&mut self,
self_: Resource<DecryptionKey>,
) -> Result<Option<Vec<u8>>>
fn algorithm_public_exponent( &mut self, self_: Resource<DecryptionKey>, ) -> Result<Option<Vec<u8>>>
See
encryption-key.algorithm-public-exponent.Source§fn can_decrypt(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
fn can_decrypt(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
Whether this key may
decrypt. See
decryption-key-options.can-decrypt.Source§fn can_unwrap(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
fn can_unwrap(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
Whether this key may
unwrap. See
decryption-key-options.can-unwrap.Source§fn extractable(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
fn extractable(&mut self, self_: Resource<DecryptionKey>) -> Result<bool>
Whether the export functions may return this key’s material.
See
decryption-key-options.extractable.Source§impl HostDecryptionKeyOptions for WasiWebcryptoCtxView<'_>
impl HostDecryptionKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<DecryptionKeyOptions>>
Source§fn can_decrypt(
&mut self,
self_: Resource<DecryptionKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_decrypt( &mut self, self_: Resource<DecryptionKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
decrypt. Disabled by default.Source§fn can_unwrap(
&mut self,
self_: Resource<DecryptionKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_unwrap( &mut self, self_: Resource<DecryptionKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
unwrap. Disabled by default.Source§fn extractable(
&mut self,
self_: Resource<DecryptionKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<DecryptionKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported
(
decryption-key.export-key-jwk/-pkcs8 and the
to-wrap-input-* functions). Disabled by default.Source§impl HostDeriveInput for WasiWebcryptoCtxView<'_>
impl HostDeriveInput for WasiWebcryptoCtxView<'_>
Source§fn can_derive_bits(&mut self, self_: Resource<DeriveInput>) -> Result<bool>
fn can_derive_bits(&mut self, self_: Resource<DeriveInput>) -> Result<bool>
Whether
derive-bits (and minting extractable keys) is
permitted. See derive-options.can-derive-bits.Source§fn can_derive_key(&mut self, self_: Resource<DeriveInput>) -> Result<bool>
fn can_derive_key(&mut self, self_: Resource<DeriveInput>) -> Result<bool>
Whether the target interfaces’
derive-key is permitted. See
derive-options.can-derive-key.Source§impl HostDeriveOptions for WasiWebcryptoCtxView<'_>
impl HostDeriveOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<DeriveOptions>>
Source§fn can_derive_bits(
&mut self,
self_: Resource<DeriveOptions>,
allowed: bool,
) -> Result<()>
fn can_derive_bits( &mut self, self_: Resource<DeriveOptions>, allowed: bool, ) -> Result<()>
Whether inputs built on this base secret may yield raw bits
through
derive-input.derive-bits, and — because an extractable
key is bits disclosure by other means — whether they may mint
extractable keys. Disabled by default.Source§fn can_derive_key(
&mut self,
self_: Resource<DeriveOptions>,
allowed: bool,
) -> Result<()>
fn can_derive_key( &mut self, self_: Resource<DeriveOptions>, allowed: bool, ) -> Result<()>
Whether inputs built on this base secret may mint keys through
the target interfaces’
derive-key. Disabled by default.Source§impl HostDigest for WasiWebcryptoCtxView<'_>
impl HostDigest for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<Digest>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<Digest>) -> Result<String>
The registry name of the algorithm this resource is bound to,
e.g.
"SHA-256" (as crypto.subtle.digest spells it). For a
digest the algorithm is the hash, so there is no separate
algorithm-hash getter.Source§impl HostEncryptionKey for WasiWebcryptoCtxView<'_>
impl HostEncryptionKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<EncryptionKey>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<EncryptionKey>) -> Result<String>
The registry name of the algorithm family this key is bound
to, e.g.
"RSA-OAEP" (WebCrypto’s KeyAlgorithm.name).Source§fn algorithm_hash(
&mut self,
self_: Resource<EncryptionKey>,
) -> Result<Option<String>>
fn algorithm_hash( &mut self, self_: Resource<EncryptionKey>, ) -> Result<Option<String>>
The digest bound at mint, e.g.
"SHA-256".Source§fn algorithm_length(
&mut self,
self_: Resource<EncryptionKey>,
) -> Result<Option<u32>>
fn algorithm_length( &mut self, self_: Resource<EncryptionKey>, ) -> Result<Option<u32>>
The key’s length in bits for algorithms parameterized by one
(the RSA modulus length).
Source§fn algorithm_public_exponent(
&mut self,
self_: Resource<EncryptionKey>,
) -> Result<Option<Vec<u8>>>
fn algorithm_public_exponent( &mut self, self_: Resource<EncryptionKey>, ) -> Result<Option<Vec<u8>>>
The public exponent for RSA-family keys, as WebCrypto’s
RsaKeyAlgorithm.publicExponent denominates it: the
exponent’s big-endian bytes ([1, 0, 1] for 65537). none
for algorithms without one.Source§impl HostIkm for WasiWebcryptoCtxView<'_>
impl HostIkm for WasiWebcryptoCtxView<'_>
Source§fn can_derive_bits(&mut self, self_: Resource<Ikm>) -> Result<bool>
fn can_derive_bits(&mut self, self_: Resource<Ikm>) -> Result<bool>
Whether inputs prepared from this material may yield raw bits.
Source§fn can_derive_key(&mut self, self_: Resource<Ikm>) -> Result<bool>
fn can_derive_key(&mut self, self_: Resource<Ikm>) -> Result<bool>
Whether inputs prepared from this material may mint keys.
Source§impl HostKwKey for WasiWebcryptoCtxView<'_>
impl HostKwKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<KwKey>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<KwKey>) -> Result<String>
The registry name of the algorithm family this key is bound
to, e.g.
"AES-KW" (WebCrypto’s KeyAlgorithm.name).
Parameters are separate getters, as for
mac-key.algorithm-name.Source§fn algorithm_length(&mut self, self_: Resource<KwKey>) -> Result<u32>
fn algorithm_length(&mut self, self_: Resource<KwKey>) -> Result<u32>
The key length in bits, e.g.
256 (WebCrypto’s
AesKeyAlgorithm.length).Source§fn extractable(&mut self, self_: Resource<KwKey>) -> Result<bool>
fn extractable(&mut self, self_: Resource<KwKey>) -> Result<bool>
Whether the key material may be exported.
Source§fn can_wrap(&mut self, self_: Resource<KwKey>) -> Result<bool>
fn can_wrap(&mut self, self_: Resource<KwKey>) -> Result<bool>
Whether this key permits
wrap. A refused operation fails
error.not-permitted.Source§fn can_unwrap(&mut self, self_: Resource<KwKey>) -> Result<bool>
fn can_unwrap(&mut self, self_: Resource<KwKey>) -> Result<bool>
Whether this key permits
unwrap. See can-wrap.Source§impl HostKwKeyOptions for WasiWebcryptoCtxView<'_>
impl HostKwKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<KwKeyOptions>>
Source§fn can_wrap(
&mut self,
self_: Resource<KwKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_wrap( &mut self, self_: Resource<KwKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
wrap. Disabled by default.Source§fn can_unwrap(
&mut self,
self_: Resource<KwKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_unwrap( &mut self, self_: Resource<KwKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
unwrap. Disabled by default.Source§fn extractable(
&mut self,
self_: Resource<KwKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<KwKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported. Disabled by
default.
Source§impl HostMacKey for WasiWebcryptoCtxView<'_>
impl HostMacKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<MacKey>) -> Result<String>
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>>
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>
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>
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>
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>
fn can_verify(&mut self, self_: Resource<MacKey>) -> Result<bool>
Whether this key permits
verify. See can-sign.Source§impl HostMacKeyOptions for WasiWebcryptoCtxView<'_>
impl HostMacKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<MacKeyOptions>>
Source§fn can_sign(
&mut self,
self_: Resource<MacKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_sign( &mut self, self_: Resource<MacKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
sign. Disabled by default.Source§fn can_verify(
&mut self,
self_: Resource<MacKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_verify( &mut self, self_: Resource<MacKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
verify. Disabled by default.Source§fn extractable(
&mut self,
self_: Resource<MacKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<MacKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported. Disabled by
default.
Source§impl HostPassword for WasiWebcryptoCtxView<'_>
impl HostPassword for WasiWebcryptoCtxView<'_>
Source§fn can_derive_bits(&mut self, self_: Resource<Password>) -> Result<bool>
fn can_derive_bits(&mut self, self_: Resource<Password>) -> Result<bool>
Whether inputs prepared from this password may yield raw bits.
Source§fn can_derive_key(&mut self, self_: Resource<Password>) -> Result<bool>
fn can_derive_key(&mut self, self_: Resource<Password>) -> Result<bool>
Whether inputs prepared from this password may mint keys.
Source§impl HostPublicKey for WasiWebcryptoCtxView<'_>
impl HostPublicKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(
&mut self,
self_: Resource<AgreementPublicKey>,
) -> Result<String>
fn algorithm_name( &mut self, self_: Resource<AgreementPublicKey>, ) -> Result<String>
The registry name of the algorithm family this key is bound to,
e.g.
"X25519" (the Web Cryptography API’s
KeyAlgorithm.name).Source§impl HostSecretKey for WasiWebcryptoCtxView<'_>
impl HostSecretKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(
&mut self,
self_: Resource<AgreementSecretKey>,
) -> Result<String>
fn algorithm_name( &mut self, self_: Resource<AgreementSecretKey>, ) -> Result<String>
See
public-key.algorithm-name.Source§fn can_derive_bits(
&mut self,
self_: Resource<AgreementSecretKey>,
) -> Result<bool>
fn can_derive_bits( &mut self, self_: Resource<AgreementSecretKey>, ) -> Result<bool>
Whether inputs agreed by this key may yield raw bits. See
agreement-key-options.can-derive-bits.Source§fn can_derive_key(
&mut self,
self_: Resource<AgreementSecretKey>,
) -> Result<bool>
fn can_derive_key( &mut self, self_: Resource<AgreementSecretKey>, ) -> Result<bool>
Whether inputs agreed by this key may mint keys. See
agreement-key-options.can-derive-key.Source§fn extractable(&mut self, self_: Resource<AgreementSecretKey>) -> Result<bool>
fn extractable(&mut self, self_: Resource<AgreementSecretKey>) -> Result<bool>
Whether the export functions may return this key’s material.
See
agreement-key-options.extractable.Source§impl HostSigningKey for WasiWebcryptoCtxView<'_>
impl HostSigningKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<SigningKey>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<SigningKey>) -> Result<String>
See
verifying-key.algorithm-name.Source§fn algorithm_curve(
&mut self,
self_: Resource<SigningKey>,
) -> Result<Option<String>>
fn algorithm_curve( &mut self, self_: Resource<SigningKey>, ) -> Result<Option<String>>
See
verifying-key.algorithm-curve.Source§fn algorithm_hash(
&mut self,
self_: Resource<SigningKey>,
) -> Result<Option<String>>
fn algorithm_hash( &mut self, self_: Resource<SigningKey>, ) -> Result<Option<String>>
See
verifying-key.algorithm-hash.Source§fn algorithm_length(
&mut self,
self_: Resource<SigningKey>,
) -> Result<Option<u32>>
fn algorithm_length( &mut self, self_: Resource<SigningKey>, ) -> Result<Option<u32>>
See
verifying-key.algorithm-length.Source§fn algorithm_public_exponent(
&mut self,
self_: Resource<SigningKey>,
) -> Result<Option<Vec<u8>>>
fn algorithm_public_exponent( &mut self, self_: Resource<SigningKey>, ) -> Result<Option<Vec<u8>>>
See
verifying-key.algorithm-public-exponent.Source§fn extractable(&mut self, self_: Resource<SigningKey>) -> Result<bool>
fn extractable(&mut self, self_: Resource<SigningKey>) -> Result<bool>
Whether the export functions may return this key’s material.
Mint-time recorded policy, which platform-backed key storage
also honors.
Source§fn can_sign(&mut self, self_: Resource<SigningKey>) -> Result<bool>
fn can_sign(&mut self, self_: Resource<SigningKey>) -> Result<bool>
Whether this key permits
sign. A refused operation fails
error.not-permitted.Source§impl HostSigningKeyOptions for WasiWebcryptoCtxView<'_>
impl HostSigningKeyOptions for WasiWebcryptoCtxView<'_>
fn new(&mut self) -> Result<Resource<SigningKeyOptions>>
Source§fn can_sign(
&mut self,
self_: Resource<SigningKeyOptions>,
allowed: bool,
) -> Result<()>
fn can_sign( &mut self, self_: Resource<SigningKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key may
sign. Disabled by default, and it
is the sole usage, so it must be enabled for the mint to
succeed (an untouched options resource fails
error.not-permitted).Source§fn extractable(
&mut self,
self_: Resource<SigningKeyOptions>,
allowed: bool,
) -> Result<()>
fn extractable( &mut self, self_: Resource<SigningKeyOptions>, allowed: bool, ) -> Result<()>
Whether the minted key’s material may be exported
(
signing-key.export-key-jwk/-pkcs8 and the
to-wrap-input-* functions). Disabled by default.Source§impl HostVerifyingKey for WasiWebcryptoCtxView<'_>
impl HostVerifyingKey for WasiWebcryptoCtxView<'_>
Source§fn algorithm_name(&mut self, self_: Resource<VerifyingKey>) -> Result<String>
fn algorithm_name(&mut self, self_: Resource<VerifyingKey>) -> Result<String>
The registry name of the algorithm family this key is bound to,
e.g.
"Ed25519" or "ECDSA" (WebCrypto’s KeyAlgorithm.name).Source§fn algorithm_curve(
&mut self,
self_: Resource<VerifyingKey>,
) -> Result<Option<String>>
fn algorithm_curve( &mut self, self_: Resource<VerifyingKey>, ) -> Result<Option<String>>
The registry name of the curve for algorithms parameterized by
one, e.g.
"P-256" (WebCrypto’s EcKeyAlgorithm.namedCurve).
none for Ed25519, whose curve is implied by the name.Source§fn algorithm_hash(
&mut self,
self_: Resource<VerifyingKey>,
) -> Result<Option<String>>
fn algorithm_hash( &mut self, self_: Resource<VerifyingKey>, ) -> Result<Option<String>>
The digest bound at mint, e.g.
"SHA-256". none for Ed25519:
RFC 8032 fixes SHA-512 internally, so it is not a parameter.Source§fn algorithm_length(
&mut self,
self_: Resource<VerifyingKey>,
) -> Result<Option<u32>>
fn algorithm_length( &mut self, self_: Resource<VerifyingKey>, ) -> Result<Option<u32>>
The key’s length in bits for algorithms parameterized by one —
the RSA modulus length (WebCrypto’s
RsaKeyAlgorithm.modulusLength). none for Ed25519 and
ECDSA, whose key size is fixed by the algorithm or curve.Source§fn algorithm_public_exponent(
&mut self,
self_: Resource<VerifyingKey>,
) -> Result<Option<Vec<u8>>>
fn algorithm_public_exponent( &mut self, self_: Resource<VerifyingKey>, ) -> Result<Option<Vec<u8>>>
The public exponent for RSA-family keys, as WebCrypto’s
RsaKeyAlgorithm.publicExponent denominates it: the
exponent’s big-endian bytes ([1, 0, 1] for 65537). none
for algorithms without one (Ed25519, ECDSA).impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl Host for WasiWebcryptoCtxView<'_>
impl HostUnwrapInput for WasiWebcryptoCtxView<'_>
impl HostWrapInput for WasiWebcryptoCtxView<'_>
Auto Trait Implementations§
impl<'a> Freeze for WasiWebcryptoCtxView<'a>
impl<'a> !RefUnwindSafe for WasiWebcryptoCtxView<'a>
impl<'a> Send for WasiWebcryptoCtxView<'a>
impl<'a> !Sync for WasiWebcryptoCtxView<'a>
impl<'a> Unpin for WasiWebcryptoCtxView<'a>
impl<'a> UnsafeUnpin for WasiWebcryptoCtxView<'a>
impl<'a> !UnwindSafe for WasiWebcryptoCtxView<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more