Documentation
¶
Overview ¶
Package card builds, signs and verifies a party's card.
A card travels and is stored as its exact bytes plus a detached Ed25519 signature by the party's root key. The signature is checked over the raw bytes before any parsing, so no JSON canonicalization is needed: a card whose signature fails is never parsed.
Unknown fields follow SSH certificates: a card names in its top-level "critical" list the fields a reader must understand; a critical field this reader does not know refuses the whole card, and any other unknown field is ignored. The rule applies to top-level fields.
Index ¶
Constants ¶
const Version = 1
Version is the card format version this reader understands.
Variables ¶
var ( ErrSignature = errors.New("card: root signature does not verify") ErrCriticalUnknown = errors.New("card: unknown critical field") ErrParty = errors.New("card: party is not the signing root") )
Errors a reader can match.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
V int `json:"v"`
Party string `json:"party"`
Keys []Key `json:"keys"`
Agents []Agent `json:"agents"`
Relays []string `json:"relays"`
Issued time.Time `json:"issued"`
// Details is the in-channel extension (receiver types, model, policy);
// absent from the card placed as envelope #0.
Details json.RawMessage `json:"details,omitempty"`
// Critical names the top-level fields a reader must understand.
Critical []string `json:"critical,omitempty"`
}
Card is a party's self-signed description: its root key, its operational keys, its agents and its relays.
type Key ¶
type Key struct {
Identity string `json:"identity"`
RegistrationID uint32 `json:"registrationId"`
SignedPrekey SignedPrekey `json:"signedPrekey"`
From time.Time `json:"from"`
Until *time.Time `json:"until"`
}
Key is one operational key bundle; the libsignal device id is always keys.DeviceID.
func (*Key) IdentityKey ¶
IdentityKey is the key's libsignal identity public key.
func (*Key) Retired ¶
Retired reports whether the key's void time has passed — the revocation a rotation card carries (design §3.2): the new identity key, and the old key's until. A retired key signs nothing and opens nothing from then on.
func (*Key) SignedPrekeyPublic ¶
func (k *Key) SignedPrekeyPublic() (ecc.ECPublicKeyable, [64]byte, error)
SignedPrekeyPublic is the signed prekey's public key and its signature.
type SignedPrekey ¶
SignedPrekey is the public half of a signed prekey and the identity key's XEdDSA signature over its serialized public key.