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 withMessageSigning(message) method on Android or withMessageToSign(message)on iOS.
Example
Android
iOS
1
// user signing public key
2
val userSigningKey: String? = Keyless.getUserSigningPublicKey()
3
4
val keyResult = Keyless.getDeviceEncryptionPublicKey(getApplication<Application>().applicationContext)
5
when (keyResult) {
6
is Keyless.KeylessResult.Success -> {
7
// use the device key
8
val deviceKey = result.value
9
}
10
is Keyless.KeylessResult.Failure -> {
11
Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
12
}
13
}
14
15
val decryptResult = Keyless.decryptWithDeviceKey(cypherText)
16
when (decryptResult) {
17
is Keyless.KeylessResult.Success -> {
18
// use the plain text
19
val plain: ByteArray = decryptResult.value
20
}
21
is Keyless.KeylessResult.Failure -> {
22
Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
23
}
24
}
Copied!
1
let deviceKey = KeylessSDK.getDeviceEncryptionKey()
2
let clearText = KeylessSDK.decryptWithDeviceKey(cipherText)
3
let userSigningKey = KeylessSDK.getUserSigningPublicKey()
Copied!
Export as PDF
Copy link