Skip to main content

Crate kc

Crate kc 

Source
Expand description

Reading and writing macOS .keychain database files directly.

This is the CDSA-era keychain format — the one security create-keychain still writes on macOS 26 — parsed and produced without the Security framework, so it works on any host and needs no entitlements.

  • format is the kych container: tables, records, attribute values.
  • schema is the self-describing schema every keychain carries.
  • crypto is the encryption the container specification omits.
  • db ties them together: open, unlock, query, decrypt.
  • write creates keychains and adds items.

See README.md for the format notes and the security caveats.

Re-exports§

pub use db::Info;
pub use db::Item;
pub use db::KeychainFile;
pub use db::Query;
pub use error::Error;
pub use error::Result;
pub use format::Keychain;
pub use format::Record;
pub use format::Value;
pub use schema::AttributeFormat;
pub use schema::RecordType;
pub use schema::Schema;
pub use write::CreateOptions;
pub use write::NewItem;
pub use write::create;

Modules§

acl
Public ACL blobs, parsed and produced as structures.
apple_schema
Apple’s keychain schema, as data.
crypto
Keychain cryptography: master key derivation, the database blob, wrapped item keys, and item secrets.
cssm
CSSM structures that appear inside keychain blobs, as types.
db
Opening, unlocking, and querying a keychain database.
der
Just enough DER to fill in a certificate record’s attributes.
error
Errors for keychain parsing, crypto, and item lookup.
format
The kych container: file header, tables, records, attribute values.
index
Table indexes: the sorted lookup structures in the trailing part of a table.
output
Rendering for the kc binary: the two shapes its output takes.
records
Typed records: the attribute sets stored for an item and for its key.
requirement
Reading an application’s designated requirement out of its code signature.
schema
Relations and attributes — the schema a keychain carries about itself.
secret
Secret bytes and the randomness that produces them.
write
Creating keychains and adding items.