public abstract class KeyStoreManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
KeyStoreManager.CertUsage |
static class |
KeyStoreManager.KeyAlgorithm |
static class |
KeyStoreManager.KeySize |
Modifier and Type | Field and Description |
---|---|
static String |
ANON_COMMON_NAME |
static int |
ANON_EXPIRATION_YEARS |
static String |
ANON_IDENTITY_ALIAS |
Constructor and Description |
---|
KeyStoreManager() |
Modifier and Type | Method and Description |
---|---|
static void |
checkAlias(String alias) |
abstract void |
createSelfSignedCertEntry(KeyStore keyStore,
String alias,
char[] keyPassword,
boolean isServer,
Map<String,String> attributes,
Date expiration) |
abstract byte[] |
decrypt(C4KeyPair keyPair,
byte[] data)
Decrypts data using the private key.
|
abstract int |
deleteEntries(KeyStore keyStore,
Fn.Predicate<String> filter) |
abstract boolean |
findAlias(KeyStore keyStore,
String targetAlias) |
abstract void |
free(C4KeyPair keyPair)
Called when the C4KeyPair is released and the externalKey is no longer needed
and when associated resources may be freed
|
abstract List<Certificate> |
getCertificateChain(KeyStore keyStore,
String keyAlias) |
static KeyStoreManager |
getInstance() |
abstract PrivateKey |
getKey(KeyStore keyStore,
String keyAlias,
char[] keyPassword) |
abstract byte[] |
getKeyData(C4KeyPair keyPair)
Provides the _public_ key's raw data, as an ASN.1 DER sequence of [modulus, exponent].
|
static void |
setInstance(KeyStoreManager mgr) |
abstract byte[] |
sign(C4KeyPair keyPair,
Signature.SignatureDigestAlgorithm digestAlgorithm,
byte[] data)
Uses the private key to generate a signature of input data.
|
public static final String ANON_IDENTITY_ALIAS
public static final String ANON_COMMON_NAME
public static final int ANON_EXPIRATION_YEARS
@NonNull public static KeyStoreManager getInstance()
public static void checkAlias(@NonNull String alias) throws CouchbaseLiteException
CouchbaseLiteException
public static void setInstance(KeyStoreManager mgr)
@Nullable public abstract byte[] getKeyData(@NonNull C4KeyPair keyPair)
keyPair
- The key pair@Nullable public abstract byte[] sign(@NonNull C4KeyPair keyPair, @NonNull Signature.SignatureDigestAlgorithm digestAlgorithm, @NonNull byte[] data)
keyPair
- The key pairdigestAlgorithm
- Indicates what type of digest to create the signature from.data
- The data to be signed.@Nullable public abstract byte[] decrypt(@NonNull C4KeyPair keyPair, @NonNull byte[] data)
keyPair
- The key pairdata
- The data to be encrypted.public abstract void free(@NonNull C4KeyPair keyPair)
keyPair
- The key pairpublic abstract boolean findAlias(@Nullable KeyStore keyStore, @NonNull String targetAlias) throws CouchbaseLiteException
CouchbaseLiteException
@Nullable public abstract PrivateKey getKey(@Nullable KeyStore keyStore, @NonNull String keyAlias, @Nullable char[] keyPassword)
@Nullable public abstract List<Certificate> getCertificateChain(@Nullable KeyStore keyStore, @NonNull String keyAlias)
public abstract void createSelfSignedCertEntry(@Nullable KeyStore keyStore, @NonNull String alias, @Nullable char[] keyPassword, boolean isServer, @NonNull Map<String,String> attributes, @Nullable Date expiration) throws CouchbaseLiteException
CouchbaseLiteException
public abstract int deleteEntries(@Nullable KeyStore keyStore, Fn.Predicate<String> filter) throws CouchbaseLiteException
CouchbaseLiteException