- Basic — a self-asserted key pair. The client ID is embedded directly in the credential. No external PKI required.
- X.509 — a certificate chain issued through the Wire end-to-end identity (E2EI) ACME flow. Provides verifiable identity including display name, handle, and domain.
CredentialRef, which is a thin handle that can safely cross the FFI boundary.
Types
CredentialType
A self-asserted credential containing only a key pair. The client ID (bytes) is the sole identity claim. No expiry.
An X.509 certificate chain obtained through the E2EI enrollment process. Contains verifiable identity claims (display name, handle, domain) and an expiry date.
Credential
The full credential object. Stores the ciphersuite, credential type, MLS credential value, signature key pair, and earliest validity timestamp.
| Method | Return | Description |
|---|---|---|
credential_type() | CredentialType | Basic or X509 |
ciphersuite() | Ciphersuite | Associated ciphersuite |
signature_scheme() | SignatureScheme | Derived from ciphersuite |
client_id() | &ClientIdRef | The client identity bytes |
earliest_validity() | u64 | Unix timestamp; only meaningful for X.509 |
mls_credential() | &MlsCredential | The underlying OpenMLS credential |
CredentialRef
A lightweight reference to a stored Credential. Safe to pass across the FFI boundary. Resolves back to the full Credential via credential_ref.load(&database).await.
The CredentialRef encodes the client ID and a hash of the credential for O(1) lookup in the keystore.
CertificateBundle
Packages the DER-encoded certificate chain and private key for creating an X.509 credential.
DER-encoded certificates. Index 0 is the leaf (end-entity) certificate. Subsequent entries are intermediate CA certificates up to (but not including) the root CA.
The private signing key corresponding to the leaf certificate’s public key. Zeroized on drop.
The signature scheme of the private key (e.g.
ECDSA_SECP256R1_SHA256, ED25519).| Method | Return | Description |
|---|---|---|
get_client_id() | Result<ClientId> | Reads the Wire client ID from the leaf certificate’s subject |
get_created_at() | Result<u64> | Reads the NotBefore claim as a Unix timestamp |
TransactionContext methods
add_credential
CredentialRef. The credential’s embedded client ID must match the session’s client ID.
A
Credential value created with Credential::basic or Credential::x509.A lightweight reference to the stored credential.
remove_credential
CredentialStillInUse if the credential is referenced by any current conversation’s leaf node. You must first rotate the credential out of all conversations with set_credential_by_ref.
Reference to the credential to remove.
find_credentials
CredentialFindFilters::builder() to construct filters (by credential type, ciphersuite, etc.).
get_credentials
Credential and MLS identity
Each MLS leaf node carries exactly one credential. When a commit adds a member, their key package’s credential is embedded in the ratchet tree and becomes visible to all other members. CoreCrypto uses the credential to:- Sign outgoing commits, proposals, and application messages.
- Identify group members via
get_client_idsandget_device_identities. - Compute E2EI conversation state — whether all members hold valid X.509 credentials.
PkiEnvironment at the time the credential is used in a commit or proposal.