Protocols
The following protocols are available globally.
-
Defines the protocol for a client.
See moreDeclaration
Swift
public protocol CoreCryptoProtocol : CoreCryptoFfiProtocol -
A unique identifier for an MLS client.
Each app instance a user is running, such as desktop or mobile, is a separate client with its own client id. A single user may therefore have multiple clients. More information: https://messaginglayersecurity.rocks/mls-architecture/draft-ietf-mls-architecture.html#name-group-members-and-clients
See moreDeclaration
Swift
public protocol ClientIdProtocol : AnyObject, Sendable -
A unique identifier for a single conversation.
The backend provides an opaque string identifying a new conversation. Construct an instance of this newtype to pass that identifier to Rust.
See moreDeclaration
Swift
public protocol ConversationIdProtocol : AnyObject, Sendable -
A
CoreCryptoCommandhas anexecutemethod which accepts aCoreCryptoContextand returns nothing.It is the argument to a
See moreCoreCrypto::transactioncall.Declaration
Swift
public protocol CoreCryptoCommand : AnyObject, Sendable -
The
CoreCryptoContextholds the primaryCoreCryptoAPIs.An instance of this struct is provided to the closure passed to
CoreCryptoFfi::transaction.Every mutable operation is done through this struct. Operations are buffered in memory and persisted to the keystore when the transaction completes.
See moreDeclaration
Swift
public protocol CoreCryptoContextProtocol : AnyObject, Sendable -
CoreCrypto wraps around MLS and Proteus implementations and provides a transactional interface for each.
See moreDeclaration
Swift
public protocol CoreCryptoFfiProtocol : AnyObject, Sendable -
A callback interface for forwarding CoreCrypto log messages to the platform’s logging system.
See moreDeclaration
Swift
public protocol CoreCryptoLogger : AnyObject, Sendable -
A cryptographic credential.
This is tied to a particular client via either its client id or certificate bundle, depending on its credential type, but is independent of any client instance or storage.
To attach a credential to a client instance and store it, call
See moreadd_credentialon aCoreCryptoContext.Declaration
Swift
public protocol CredentialProtocol : AnyObject, Sendable -
A compact reference to a credential that has been persisted in CoreCrypto.
Credentials can be quite large; this type avoids passing them back and forth across the FFI boundary more than strictly required.
Created by calling
add_credentialon aCoreCryptoContext.This reference is not a literal in-memory reference. It is instead the key from which a credential can be retrieved, and is stable over time and across the FFI boundary.
See moreDeclaration
Swift
public protocol CredentialRefProtocol : AnyObject, Sendable -
The database acting as a core crypto keystore.
See moreDeclaration
Swift
public protocol DatabaseProtocol : AnyObject, Sendable -
DatabaseKeyProtocolFrom WireCoreCryptoUniffiThe key used to encrypt the database.
Declaration
Swift
public protocol DatabaseKeyProtocol : AnyObject, Sendable -
An
See moreEpochObserveris notified whenever a conversation’s epoch changes.Declaration
Swift
public protocol EpochObserver : AnyObject, Sendable -
The raw public key of an external sender.
This can be used to initialize a subconversation.
See moreDeclaration
Swift
public protocol ExternalSenderKeyProtocol : AnyObject, Sendable -
MLS Group Information
This is used when joining by external commit. It can be found within the
See moreGroupInfoBundlewithin aCommitBundle.Declaration
Swift
public protocol GroupInfoProtocol : AnyObject, Sendable -
A
See moreHistoryObserveris notified whenever a new history client is created.Declaration
Swift
public protocol HistoryObserver : AnyObject, Sendable -
A signed object describing a client’s identity and capabilities.
Includes a public key that can be used to encrypt to that client. Other clients can use a client’s KeyPackage to introduce that client to a new group.
See moreDeclaration
Swift
public protocol KeypackageProtocol : AnyObject, Sendable -
A lightweight distinct reference to a
KeyPackage, sufficient to uniquely identify it.This contains some metadata to assist in sorting and filtering refs without needing to perform the relatively heavy operation of converting to a full keypackage.
See moreDeclaration
Swift
public protocol KeypackageRefProtocol : AnyObject, Sendable -
Used by CoreCrypto to send commits or application messages to the delivery service.
This trait must be implemented before calling any functions that produce commits.
See moreDeclaration
Swift
public protocol MlsTransport : AnyObject, Sendable -
PkiEnvironmentProtocolFrom WireCoreCryptoUniffiThe PKI environment used for certificate management during X509 credential acquisition.
Declaration
Swift
public protocol PkiEnvironmentProtocol : AnyObject, Sendable -
Callbacks for external calls made by CoreCrypto during X509 credential acquisition.
When communicating with the Identity Provider (IDP) and Wire server, CoreCrypto delegates to the client app by calling the relevant methods.
Client App CoreCrypto Acme IDP | | | | | X509CredentialAcquisition().finalize() | | |————————–>| | | | | GET acme/root.pem | | | |————————> | | | | 200 OK | | | |<———————— | | | authenticate() | | | |<————————–| | | | | Authentication flow | | | —————————————————————————-> | |<—————————————————————————– | | return Success [PKiEnvironmentHooks.authenticate()] | | |<————————–| | | | | (excluded several calls for brevity) | | return Success(Credential) [X509CredentialAcquisition().finalize()] | |<————————–| | |
See moreDeclaration
Swift
public protocol PkiEnvironmentHooks : AnyObject, Sendable -
Declaration
Swift
public protocol SecretKeyProtocol : AnyObject, Sendable -
A TLS-serialized Welcome message.
This structure is defined in RFC 9420: https://www.rfc-editor.org/rfc/rfc9420.html#joining-via-welcome-message.
See moreDeclaration
Swift
public protocol WelcomeProtocol : AnyObject, Sendable
Protocols Reference