BiometricPrompt.CryptoObject
class BiometricPrompt.CryptoObject
A wrapper class for the crypto objects supported by BiometricPrompt.
Summary
Public constructors |
|---|
CryptoObject(cipher: Cipher)Creates a crypto object that wraps the given cipher object. |
@RequiresApi(value = Build.VERSION_CODES.R)This function is deprecated. Use |
CryptoObject(mac: Mac)Creates a crypto object that wraps the given MAC object. |
@RequiresApi(value = Build.VERSION_CODES.VANILLA_ICE_CREAM)Create from an operation handle. |
@RequiresApi(value = Build.VERSION_CODES.TIRAMISU)Creates a crypto object that wraps the given presentation session object. |
CryptoObject(signature: Signature)Creates a crypto object that wraps the given signature object. |
Public functions |
|
|---|---|
Cipher? |
Gets the cipher object associated with this crypto object. |
IdentityCredential? |
This function is deprecated. Use |
Mac? |
getMac()Gets the MAC object associated with this crypto object. |
Long |
Returns the |
PresentationSession? |
Gets the presentation session object associated with this crypto object. |
Signature? |
Gets the signature object associated with this crypto object. |
Public constructors
CryptoObject
CryptoObject(cipher: Cipher)
Creates a crypto object that wraps the given cipher object.
| Parameters | |
|---|---|
cipher: Cipher |
The cipher to be associated with this crypto object. |
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.R)CryptoObject(identityCredential: IdentityCredential)
Creates a crypto object that wraps the given identity credential object.
| Parameters | |
|---|---|
identityCredential: IdentityCredential |
The identity credential to be associated with this crypto object. |
CryptoObject
CryptoObject(mac: Mac)
Creates a crypto object that wraps the given MAC object.
| Parameters | |
|---|---|
mac: Mac |
The MAC to be associated with this crypto object. |
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.VANILLA_ICE_CREAM)
CryptoObject(operationHandle: Long)
Create from an operation handle.
| Parameters | |
|---|---|
operationHandle: Long |
the operation handle associated with this object. |
| See also | |
|---|---|
getOperationHandle |
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.TIRAMISU)
CryptoObject(presentationSession: PresentationSession)
Creates a crypto object that wraps the given presentation session object.
| Parameters | |
|---|---|
presentationSession: PresentationSession |
The presentation session to be associated with this crypto object. |
CryptoObject
CryptoObject(signature: Signature)
Creates a crypto object that wraps the given signature object.
| Parameters | |
|---|---|
signature: Signature |
The signature to be associated with this crypto object. |
Public functions
getCipher
fun getCipher(): Cipher?
Gets the cipher object associated with this crypto object.
| Returns | |
|---|---|
Cipher? |
The cipher, or |
getIdentityCredential
@RequiresApi(value = Build.VERSION_CODES.R)
fungetIdentityCredential(): IdentityCredential?
Gets the identity credential object associated with this crypto object.
| Returns | |
|---|---|
IdentityCredential? |
The identity credential, or |
getMac
fun getMac(): Mac?
Gets the MAC object associated with this crypto object.
| Returns | |
|---|---|
Mac? |
The MAC, or |
getOperationHandle
@RequiresApi(value = Build.VERSION_CODES.VANILLA_ICE_CREAM)
fun getOperationHandle(): Long
Returns the operationHandle associated with this object or 0 if none. The operationHandle is the underlying identifier associated with the CryptoObject.
The operationHandle can be used to reconstruct a CryptoObject instance. This is useful for any cross-process communication as the CryptoObject class is not android.os.Parcelable. Hence, if the CryptoObject is constructed in one process, and needs to be propagated to another process, before calling the authenticate() API in the second process, the recommendation is to retrieve the operationHandle using this API, and then reconstruct the CryptoObjectusing the constructor that takes in an
operationHandle, and pass that in to the authenticate API mentioned above.
getPresentationSession
@RequiresApi(value = Build.VERSION_CODES.TIRAMISU)
fun getPresentationSession(): PresentationSession?
Gets the presentation session object associated with this crypto object.
| Returns | |
|---|---|
PresentationSession? |
The presentation session, or |
getSignature
fun getSignature(): Signature?
Gets the signature object associated with this crypto object.
| Returns | |
|---|---|
Signature? |
The signature, or |