Signature Helper
SignatureHelper provides utility methods to generate and manage key pairs in the Android KeyStore. This class supports generating hardware-backed key pairs, signing data, verifying signatures, and managing KeyStore entries.
Parameters
The alias of the key entry in the KeyStore.
Indicates if strong biometric authentication is required for accessing the key.
The algorithm to be used for signing data. Default is DsaAlgorithms.SHA384_WITH_ECDSA.
The provider for the KeyStore. Default is "AndroidKeyStore".
Constructors
Functions
Deletes the key entry with the specified alias from the KeyStore.
Generates and returns key pair and if the pair is inside secure hardware or returns null and removes the entry if the key pair isn't hardware backed or any error is occurred.
Generates a key pair.
Encodes the public key of the given key pair to a Base64 string.
Converts a Base64 encoded public key string to a PublicKey object.
Signs the given data using the private key associated with the specified alias, returns null if an error occurs. If biometric authentication is required, it must be performed before signing the data.
Verifies the given signature using the provided public key and data.