security-rs 0.2.1

Safe Rust bindings for Apple's Security framework — keychain, identity, certificates, trust, authorization, CMS, SecureTransport, and cryptographic primitives on macOS
Documentation
1
2
3
4
5
6
7
use security::SecureRandom;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let bytes = SecureRandom::bytes(16)?;
    println!("random_len={} first_byte={}", bytes.len(), bytes[0]);
    Ok(())
}