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§
Sourcefn n_params(&self) -> &BoxedMontyParams
fn n_params(&self) -> &BoxedMontyParams
Returns the parameters for montgomery operations.
Provided Methods§
Sourcefn size(&self) -> usize
fn size(&self) -> usize
Returns k, the modulus length in octets from RFC8017: ceil(modBits / 8).
Ciphertexts and signatures have this length, including any leading zero octets. This may be smaller than the modulus’s allocated storage width.
Sourcefn n_bits_precision(&self) -> u32
fn n_bits_precision(&self) -> u32
Returns the limb-aligned storage precision of n in bits.
This can exceed the modulus bit length (modBits in RFC8017). Use this precision for
integer arithmetic and decoding representatives, and Self::size for wire encodings.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".