Key Service
Functions
Link copied to clipboard
abstract suspend fun bootstrapCrossSigning(recoveryKey: ByteArray = SecureRandom.nextBytes(32), secretKeyEventContentGenerator: suspend () -> SecretKeyEventContent = {
val iv = SecureRandom.nextBytes(16)
AesHmacSha2Key(
iv = iv.encodeBase64(),
mac = createAesHmacSha2MacFromKey(recoveryKey, iv)
)
}): KeyService.BootstrapCrossSigning
This allows you to bootstrap cross signing. Be aware, that this could override an existing cross signing setup of the account. Be aware, that this also creates a new key backup, which could replace an existing key backup.
Link copied to clipboard
abstract suspend fun bootstrapCrossSigningFromPassphrase(passphrase: String, secretKeyEventContentGenerator: suspend () -> Pair<ByteArray, SecretKeyEventContent> = {
val passphraseInfo = AesHmacSha2Key.SecretStorageKeyPassphrase.Pbkdf2(
salt = SecureRandom.nextBytes(32).encodeBase64(),
iterations = 120_000,
bits = 32 * 8
)
val iv = SecureRandom.nextBytes(16)
val key = recoveryKeyFromPassphrase(passphrase, passphraseInfo)
key to AesHmacSha2Key(
passphrase = passphraseInfo,
iv = iv.encodeBase64(),
mac = createAesHmacSha2MacFromKey(key = key, iv = iv)
)
}): KeyService.BootstrapCrossSigning
This allows you to bootstrap cross signing. Be aware, that this could override an existing cross signing setup of the account. Be aware, that this also creates a new key backup, which could replace an existing key backup.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard