Package com.couchbase.lite
Class KeyStoreUtils
- java.lang.Object
-
- com.couchbase.lite.KeyStoreUtils
-
@Volatile public final class KeyStoreUtils extends java.lang.Object
Key Store Utilities
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANDROID_KEY_STORE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
importEntry(java.lang.String storeType, java.io.InputStream storeStream, char[] storePassword, java.lang.String extAlias, char[] extKeyPass, java.lang.String newAlias)
Imports the key entry including public key, private key, and certificates from the given KeyStore input stream into the Android KeyStore.
-
-
-
Field Detail
-
ANDROID_KEY_STORE
public static final java.lang.String ANDROID_KEY_STORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
importEntry
public static void importEntry(@NonNull java.lang.String storeType, @NonNull java.io.InputStream storeStream, @Nullable char[] storePassword, @NonNull java.lang.String extAlias, @Nullable char[] extKeyPass, @NonNull java.lang.String newAlias) throws java.security.KeyStoreException, java.security.cert.CertificateException, java.security.NoSuchAlgorithmException, java.io.IOException, java.security.UnrecoverableEntryException
Imports the key entry including public key, private key, and certificates from the given KeyStore input stream into the Android KeyStore. The imported key entry can be used as a TLSIdentity by calling TLSIdentity.get(String alias) method.NOTE: The key data including the private key data will be in memory, temporarily, during the import operation! Android 9 (API 28) or higher has an alternative method that will import keys more securely. Check the documentation here: for more info.
- Parameters:
storeType
- KeyStore type, eg: "PKCS12"storeStream
- An InputStream from the keystorestorePassword
- The keystore passwordextAlias
- The alias, in the external keystore, of the entry to be imported.extKeyPass
- The key passwordnewAlias
- The alias for the imported key- Throws:
java.security.KeyStoreException
- on failure to create keystorejava.security.cert.CertificateException
- on failure to load keystorejava.security.NoSuchAlgorithmException
- on failure to load keystorejava.io.IOException
- on failure to load keystorejava.security.UnrecoverableEntryException
- on failure to load keystore entry
-
-