Skip to main content

Module schema

Module schema 

Source
Expand description

Relations and attributes — the schema a keychain carries about itself.

A keychain is a CSSM database: four schema tables describe every other table’s attributes, so a reader does not have to hard-code the layout of password or key records. Only the four schema relations themselves need built-in definitions, to bootstrap.

Two things matter and are not obvious:

  • A record’s attribute-offset array follows the order attributes are defined in the schema table, not attribute-id order. Sorting by id silently misreads every password record.
  • Password relations name most attributes by four-char code in the AttributeID (acct, svce, srvr), leaving AttributeName empty; PrintName and Alias are the exceptions, named by string.

Structs§

AttributeDef
One attribute of a relation.
RecordType
A CSSM relation identifier (CSSM_DB_RECORDTYPE).
Relation
Schema
The schema of one keychain.

Enums§

AttributeFormat
CSSM_DB_ATTRIBUTE_FORMAT: how an attribute value is encoded.

Functions§

four_char_code
Four-char code as a big-endian integer, for building attribute ids.