public class EosioAndroidKeyStoreUtility
Utility class provides cryptographic methods to manage keys in the Android KeyStore Signature Provider and uses the keys to sign transactions.
Modifier and Type | Class and Description |
---|---|
static class |
EosioAndroidKeyStoreUtility.Companion |
Modifier and Type | Field and Description |
---|---|
static EosioAndroidKeyStoreUtility.Companion |
Companion |
Constructor and Description |
---|
EosioAndroidKeyStoreUtility()
Utility class provides cryptographic methods to manage keys in the Android KeyStore Signature Provider and uses the keys to sign transactions.
|
Modifier and Type | Method and Description |
---|---|
static void |
deleteAllKeys(java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Delete all keys in the Android KeyStore
|
static boolean |
deleteKeyByAlias(java.lang.String keyAliasToDelete,
java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Delete a key inside Android KeyStore by its alias
|
static java.lang.String |
generateAndroidKeyStoreKey(android.security.keystore.KeyGenParameterSpec keyGenParameterSpec)
Generate a new key inside Android KeyStore by the given
keyGenParameterSpec and return the new key in EOS format |
static java.lang.String |
generateAndroidKeyStoreKey(java.lang.String alias)
Generate a new key inside AndroidKeyStore by the given
alias and return the new key in EOS format |
static java.util.List<kotlin.Pair> |
getAllAndroidKeyStoreKeysInEOSFormat(java.security.KeyStore.ProtectionParameter password,
java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Get all (SECP256R1) curve keys in EOS format from Android KeyStore
|
static java.lang.String |
getAndroidKeyStoreKeyInEOSFormat(java.lang.String alias,
java.security.KeyStore.ProtectionParameter password,
java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Get all (SECP256R1) keys in EOS format from Android KeyStore
|
static kotlin.Array[] |
sign(kotlin.Array[] data,
java.lang.String alias,
java.security.KeyStore.ProtectionParameter password,
java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Sign data with a key in the KeyStore.
|
public static EosioAndroidKeyStoreUtility.Companion Companion
public EosioAndroidKeyStoreUtility()
Utility class provides cryptographic methods to manage keys in the Android KeyStore Signature Provider and uses the keys to sign transactions.
@JvmStatic @NotNull public static java.lang.String generateAndroidKeyStoreKey(@NotNull android.security.keystore.KeyGenParameterSpec keyGenParameterSpec)
Generate a new key inside Android KeyStore by the given keyGenParameterSpec
and return the new key in EOS format
The given keyGenParameterSpec
is the parameter specification to generate a new key. This specification
must include the following information if the key to be generated needs to be EOS Mainnet compliant:
KeyGenParameterSpec must include KeyProperties.PURPOSE_SIGN
KeyGenParameterSpec.getAlgorithmParameterSpec must be of type ECGenParameterSpec
KeyGenParameterSpec.getAlgorithmParameterSpec's curve name must be SECP256R1_CURVE_NAME
@JvmStatic @NotNull public static java.lang.String generateAndroidKeyStoreKey(@NotNull java.lang.String alias)
Generate a new key inside AndroidKeyStore by the given alias
and return the new key in EOS format
The given alias
is the identity of the key. The new key will be generated with the Default KeyGenParameterSpec from the generateDefaultKeyGenParameterSpecBuilder
alias
,
alias
,
KeyGenParameterSpec@JvmStatic @NotNull public static java.util.List<kotlin.Pair> getAllAndroidKeyStoreKeysInEOSFormat(@Nullable java.security.KeyStore.ProtectionParameter password, @Nullable java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Get all (SECP256R1) curve keys in EOS format from Android KeyStore
password
- KeyStore.ProtectionParameter? - the password to load all the keysloadStoreParameter
- KeyStore.LoadStoreParameter? - the KeyStore Parameter to load the KeyStore instance@JvmStatic @NotNull public static java.lang.String getAndroidKeyStoreKeyInEOSFormat(@NotNull java.lang.String alias, @Nullable java.security.KeyStore.ProtectionParameter password, @Nullable java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Get all (SECP256R1) keys in EOS format from Android KeyStore
alias
- String - the key's identitypassword
- KeyStore.ProtectionParameter? - the password to load all the keysloadStoreParameter
- KeyStore.LoadStoreParameter? - the KeyStore Parameter to load the KeyStore instance@JvmStatic @Nullable public static kotlin.Array[] sign(@NotNull kotlin.Array[] data, @NotNull java.lang.String alias, @Nullable java.security.KeyStore.ProtectionParameter password, @Nullable java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Sign data with a key in the KeyStore.
data
- ByteArray - data to be signedalias
- String - identity of the key to be used for signingpassword
- KeyStore.ProtectionParameter - password of the keyAndroidKeyStoreSigningError
@JvmStatic public static boolean deleteKeyByAlias(@NotNull java.lang.String keyAliasToDelete, @Nullable java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Delete a key inside Android KeyStore by its alias
keyAliasToDelete
- String - the alias of the key to deleteloadStoreParameter
- KeyStore.LoadStoreParameter? - the KeyStore Parameter to load the KeyStore instanceAndroidKeyStoreDeleteError
@JvmStatic public static void deleteAllKeys(@Nullable java.security.KeyStore.LoadStoreParameter loadStoreParameter)
Delete all keys in the Android KeyStore
loadStoreParameter
- KeyStore.LoadStoreParameter? - the KeyStore Parameter to load the KeyStore instance