Links

Key management

Upon enrollment, different keys are generated and accessible to the integrator to fulfill different purposes.
Device encryption Key Return the device encryption key that could be used to encrypt a message which could be decrypted using the decryptWithDeviceKey(cipherText) method.
User signing public key Return the user signing public key to verify the signature of a signed message. The message to sign could be provided to the authentication configuration using the withMessageToSign(message) method.
Example
Android
iOS
// user signing public key
val userSigningKey: String? = Keyless.getUserSigningPublicKey(accountId)
val keyResult = Keyless.getDeviceEncryptionPublicKey(getApplication<Application>().applicationContext)
when (keyResult) {
is Keyless.KeylessResult.Success -> {
// use the device key
val deviceKey = result.value
}
is Keyless.KeylessResult.Failure -> {
Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
}
}
val decryptResult = Keyless.decryptWithDeviceKey(cypherText)
when (decryptResult) {
is Keyless.KeylessResult.Success -> {
// use the plain text
val plain: ByteArray = decryptResult.value
}
is Keyless.KeylessResult.Failure -> {
Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
}
}
let deviceKey = KeylessSDK.getDeviceEncryptionKey()
let clearText = KeylessSDK.decryptWithDeviceKey(cipherText)
let userSigningKey = KeylessSDK.getUserSigningPublicKey(accountId)