BiometricPrompt.CryptoObject
public class BiometricPrompt.CryptoObject
A wrapper class for the crypto objects supported by BiometricPrompt.
Summary
Public constructors |
|---|
CryptoObject(@NonNull Cipher cipher)Creates a crypto object that wraps the given cipher object. |
@RequiresApi(value = Build.VERSION_CODES.R)This method is deprecated. Use |
CryptoObject(@NonNull 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(@NonNull Signature signature)Creates a crypto object that wraps the given signature object. |
Public methods |
|
|---|---|
@Nullable Cipher |
Gets the cipher object associated with this crypto object. |
@Nullable IdentityCredential |
This method is deprecated. Use |
@Nullable Mac |
getMac()Gets the MAC object associated with this crypto object. |
long |
Returns the |
@Nullable PresentationSession |
Gets the presentation session object associated with this crypto object. |
@Nullable Signature |
Gets the signature object associated with this crypto object. |
Public constructors
CryptoObject
public CryptoObject(@NonNull Cipher cipher)
Creates a crypto object that wraps the given cipher object.
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.R)
publicCryptoObject(@NonNull IdentityCredential identityCredential)
Creates a crypto object that wraps the given identity credential object.
| Parameters | |
|---|---|
@NonNull IdentityCredential identityCredential |
The identity credential to be associated with this crypto object. |
CryptoObject
public CryptoObject(@NonNull Mac mac)
Creates a crypto object that wraps the given MAC object.
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.VANILLA_ICE_CREAM)
public CryptoObject(long operationHandle)
Create from an operation handle.
| Parameters | |
|---|---|
long operationHandle |
the operation handle associated with this object. |
| See also | |
|---|---|
getOperationHandle |
CryptoObject
@RequiresApi(value = Build.VERSION_CODES.TIRAMISU)
public CryptoObject(@NonNull PresentationSession presentationSession)
Creates a crypto object that wraps the given presentation session object.
| Parameters | |
|---|---|
@NonNull PresentationSession presentationSession |
The presentation session to be associated with this crypto object. |
Public methods
getCipher
public @Nullable Cipher getCipher()
Gets the cipher object associated with this crypto object.
getIdentityCredential
@RequiresApi(value = Build.VERSION_CODES.R)
public @Nullable IdentityCredentialgetIdentityCredential()
Gets the identity credential object associated with this crypto object.
| Returns | |
|---|---|
@Nullable IdentityCredential |
The identity credential, or |
getMac
public @Nullable Mac getMac()
Gets the MAC object associated with this crypto object.
getOperationHandle
@RequiresApi(value = Build.VERSION_CODES.VANILLA_ICE_CREAM)
public long getOperationHandle()
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)
public @Nullable PresentationSession getPresentationSession()
Gets the presentation session object associated with this crypto object.
| Returns | |
|---|---|
@Nullable PresentationSession |
The presentation session, or |