security-rs 0.2.0

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
8
9
10
11
12
13
14
mod common;

use security::Keychain;

#[test]
fn generic_password_round_trip() -> security::Result<()> {
    let account = "integration-account";
    let service = common::unique_service("keychain");
    Keychain::set(account, &service, "secret")?;
    assert_eq!(Keychain::get(account, &service)?, "secret");
    assert!(Keychain::list_accounts(&service)?.contains(&account.to_owned()));
    Keychain::delete(account, &service)?;
    Ok(())
}