Skip to main content

PrivateKeyParts

Trait PrivateKeyParts 

Source
pub trait PrivateKeyParts: PublicKeyParts {
    // Required methods
    fn d(&self) -> &BoxedUint;
    fn primes(&self) -> &[Odd<BoxedUint>];
    fn p(&self) -> Option<&MontyParams<BoxedUint>>;
    fn q(&self) -> Option<&MontyParams<BoxedUint>>;
    fn dp(&self) -> Option<&BoxedUint>;
    fn dq(&self) -> Option<&BoxedUint>;
    fn qinv(&self) -> Option<&BoxedMontyForm>;
    fn crt_values(&self) -> Option<&[CrtValue]>;
}
Expand description

Components of an RSA private key.

Implementations used for private operations must choose all storage precisions from public parameters, not from the significant bits of secret components. In particular, d, dp, and dq are processed for their full storage precision. Prime and Montgomery-parameter precisions must follow the same public policy. RsaPrivateKey enforces this during construction.

Required Methods§

Source

fn d(&self) -> &BoxedUint

Returns the private exponent of the key.

Source

fn primes(&self) -> &[Odd<BoxedUint>]

Returns the prime factors as Odd.

Blinded non-CRT private operations require all factors to compute φ(n).

Source

fn p(&self) -> Option<&MontyParams<BoxedUint>>

Returns prime p if precomputed.

Source

fn q(&self) -> Option<&MontyParams<BoxedUint>>

Returns prime q if precomputed.

Source

fn dp(&self) -> Option<&BoxedUint>

Returns the precomputed dp value, D mod (P-1)

Source

fn dq(&self) -> Option<&BoxedUint>

Returns the precomputed dq value, D mod (Q-1)

Source

fn qinv(&self) -> Option<&BoxedMontyForm>

Returns the precomputed qinv value, Q^-1 mod P

Source

fn crt_values(&self) -> Option<&[CrtValue]>

Returns an iterator over the CRT Values

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§