Skip to main content

HostVerifyingKey

Trait HostVerifyingKey 

Source
pub trait HostVerifyingKey: Send {
    // Required methods
    fn algorithm_name(
        &mut self,
        self_: Resource<VerifyingKey>,
    ) -> Result<String>;
    fn algorithm_curve(
        &mut self,
        self_: Resource<VerifyingKey>,
    ) -> Result<Option<String>>;
    fn algorithm_hash(
        &mut self,
        self_: Resource<VerifyingKey>,
    ) -> Result<Option<String>>;
    fn algorithm_length(
        &mut self,
        self_: Resource<VerifyingKey>,
    ) -> Result<Option<u32>>;
    fn algorithm_public_exponent(
        &mut self,
        self_: Resource<VerifyingKey>,
    ) -> Result<Option<Vec<u8>>>;
}

Required Methods§

Source

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>>

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>>

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>>

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>>>

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).

Implementations on Foreign Types§

Source§

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

Source§

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>>

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>>

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>>

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>>>

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).

Implementors§