Skip to main content
This is unreleased documentation for the main (development) branch of crypto-glue.

PublicKeyParts

Trait PublicKeyParts 

Source
pub trait PublicKeyParts {
    // Required methods
    fn n(&self) -> &NonZero<BoxedUint>;
    fn e(&self) -> &BoxedUint;
    fn n_params(&self) -> &BoxedMontyParams;

    // Provided methods
    fn size(&self) -> usize { ... }
    fn n_bits_precision(&self) -> u32 { ... }
    fn n_bytes(&self) -> Box<[u8]> { ... }
    fn e_bytes(&self) -> Box<[u8]> { ... }
}
Expand description

Components of an RSA public key.

Required Methods§

Source

fn n(&self) -> &NonZero<BoxedUint>

Returns the modulus of the key.

Source

fn e(&self) -> &BoxedUint

Returns the public exponent of the key.

Source

fn n_params(&self) -> &BoxedMontyParams

Returns the parameters for montgomery operations.

Provided Methods§

Source

fn size(&self) -> usize

Returns the modulus size in bytes. Raw signatures and ciphertexts for or by this public key will have the same size.

Source

fn n_bits_precision(&self) -> u32

Returns precision (in bits) of n.

Source

fn n_bytes(&self) -> Box<[u8]>

Returns the big endian serialization of the modulus of the key

Source

fn e_bytes(&self) -> Box<[u8]>

Returns the big endian serialization of the public exponent of the key

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§