CoreCryptoCentralImpl

class CoreCryptoCentralImpl(cc: CoreCrypto, rootDir: String, database: Database) : CoreCryptoCentral

Constructors

Link copied to clipboard
constructor(cc: CoreCrypto, rootDir: String, database: Database)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun addPkiIntermediateCertificate(pem: CertificateChain)
Link copied to clipboard
open suspend override fun addPkiTrustAnchors(pemBundle: CertificateChain)

Adds every certificate from pemBundle that is not already installed. Existing trust anchors are never removed.

Link copied to clipboard
open suspend override fun checkCredentials()

Check all installed X509 credentials for expiration and revocation.

Link copied to clipboard
open suspend override fun close()

Close Core Crypto, its PKI environment, and its database after their users have stopped. A native close failure remains a failure on later calls; the account owner must retain its lease because the native binding cannot confirm successful release by retrying.

Link copied to clipboard
open suspend override fun configurePkiEnvironment(hooks: PkiEnvironmentHooks)

Creates and installs a PKI environment backed by the same encrypted database as Core Crypto.

Link copied to clipboard
open suspend override fun exportDatabaseCopy(destinationPath: String)

Export a compacted copy of the CoreCrypto database to the specified destination path. Uses SQLite's VACUUM INTO to create an encrypted copy of the database.

Link copied to clipboard
open suspend override fun getPkiTrustAnchors(): List<CertificateChain>
Link copied to clipboard
open suspend override fun hasCredential(clientId: CryptoQualifiedClientId, cipherSuite: MLSCiphersuite): Boolean

Read installed credentials without initializing a client or creating key material.

Link copied to clipboard
open suspend override fun installCredential(credential: CryptoCredential): CryptoCredentialRef

Persists credential without taking ownership of it.

Link copied to clipboard
open suspend override fun mlsClient(clientId: CryptoQualifiedClientId, defaultCipherSuite: MLSCiphersuite, mlsTransporter: MLSTransporter, epochObserver: MLSEpochObserver, coroutineScope: CoroutineScope): MLSClient
Link copied to clipboard
open suspend override fun proteusClient(): ProteusClient
Link copied to clipboard
open suspend override fun startX509CredentialAcquisition(config: X509CredentialAcquisitionConfig, existingCredentialRef: CryptoCredentialRef? = null): CryptoCredential

Starts an X509 acquisition and keeps it alive while PkiEnvironmentHooks.authenticate performs authentication. existingCredentialRef remains valid after this call.

Link copied to clipboard
suspend fun <T> transaction(name: String, block: suspend (context: CoreCryptoContext) -> T): T