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.
formatis thekychcontainer: tables, records, attribute values.schemais the self-describing schema every keychain carries.cryptois the encryption the container specification omits.dbties them together: open, unlock, query, decrypt.writecreates 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
kychcontainer: file header, tables, records, attribute values. - index
- Table indexes: the sorted lookup structures in the trailing part of a table.
- output
- Rendering for the
kcbinary: 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.