Skip to main content

SecureRandom

Trait SecureRandom 

Source
pub trait SecureRandom {
    // Required method
    fn fill_secure(
        &mut self,
        output: &mut [u8],
        kind: RngOutputKind,
    ) -> Result<(), CryptoError>;
}
Expand description

Crypto algorithm selector used by JOSE/JWT public APIs.

Consumers should import this re-export instead of depending directly on reallyme-crypto; that keeps the algorithm type identical to the one used by reallyme-jose. A source of cryptographically secure random bytes.

Required Methods§

Source

fn fill_secure( &mut self, output: &mut [u8], kind: RngOutputKind, ) -> Result<(), CryptoError>

Fills output with secure random bytes, tagging any error with kind. Returns an error if entropy is unavailable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§