Package com.couchbase.lite.internal
Class KeyStoreManagerDelegate
- java.lang.Object
-
- com.couchbase.lite.internal.KeyStoreManager
-
- com.couchbase.lite.internal.KeyStoreManagerDelegate
-
public class KeyStoreManagerDelegate extends KeyStoreManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.couchbase.lite.internal.KeyStoreManager
KeyStoreManager.CertUsage, KeyStoreManager.KeyAlgorithm, KeyStoreManager.KeySize
-
-
Field Summary
-
Fields inherited from class com.couchbase.lite.internal.KeyStoreManager
ANON_COMMON_NAME, ANON_EXPIRATION_YEARS, ANON_IDENTITY_ALIAS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSelfSignedCertEntry(KeyStore ignore1, String alias, char[] ignore2, boolean isServer, Map<String,String> attributes, Date expiration)byte[]decrypt(C4KeyPair keyPair, byte[] data)Decrypts data using the private key.intdeleteEntries(KeyStore ignore, Fn.Predicate<String> filter)booleanfindAlias(KeyStore ignore, String targetAlias)voidfree(C4KeyPair keyPair)Called when the C4KeyPair is released and the externalKey is no longer needed and when associated resources may be freedList<Certificate>getCertificateChain(KeyStore ignore, String alias)PrivateKeygetKey(KeyStore ignore1, String alias, char[] ignore2)byte[]getKeyData(C4KeyPair keyPair)Provides the _public_ key's raw data, as an ASN.1 DER sequence of [modulus, exponent].byte[]sign(C4KeyPair keyPair, Signature.SignatureDigestAlgorithm digestAlgorithm, byte[] data)Uses the private key to generate a signature of input data.-
Methods inherited from class com.couchbase.lite.internal.KeyStoreManager
checkAlias, getInstance, setInstance
-
-
-
-
Method Detail
-
getKeyData
@Nullable public byte[] getKeyData(@NonNull C4KeyPair keyPair)Description copied from class:KeyStoreManagerProvides the _public_ key's raw data, as an ASN.1 DER sequence of [modulus, exponent].- Specified by:
getKeyDatain classKeyStoreManager- Parameters:
keyPair- The key pair- Returns:
- the raw key data or null failure.
-
sign
@Nullable public byte[] sign(@NonNull C4KeyPair keyPair, @NonNull Signature.SignatureDigestAlgorithm digestAlgorithm, @NonNull byte[] data)Description copied from class:KeyStoreManagerUses the private key to generate a signature of input data.- Specified by:
signin classKeyStoreManager- Parameters:
keyPair- The key pairdigestAlgorithm- Indicates what type of digest to create the signature from.data- The data to be signed.- Returns:
- the signature (length must be equal to the key size) or null on failure.
-
decrypt
@Nullable public byte[] decrypt(@NonNull C4KeyPair keyPair, @NonNull byte[] data)Description copied from class:KeyStoreManagerDecrypts data using the private key.- Specified by:
decryptin classKeyStoreManager- Parameters:
keyPair- The key pairdata- The data to be encrypted.- Returns:
- the raw key data or null failure.
-
free
public void free(@NonNull C4KeyPair keyPair)Description copied from class:KeyStoreManagerCalled when the C4KeyPair is released and the externalKey is no longer needed and when associated resources may be freed- Specified by:
freein classKeyStoreManager- Parameters:
keyPair- The key pair
-
findAlias
public boolean findAlias(@Nullable KeyStore ignore, @NonNull String targetAlias)- Specified by:
findAliasin classKeyStoreManager
-
getKey
@Nullable public PrivateKey getKey(@Nullable KeyStore ignore1, @NonNull String alias, @Nullable char[] ignore2)
- Specified by:
getKeyin classKeyStoreManager
-
getCertificateChain
@Nullable public List<Certificate> getCertificateChain(@Nullable KeyStore ignore, @NonNull String alias)
- Specified by:
getCertificateChainin classKeyStoreManager
-
createSelfSignedCertEntry
public void createSelfSignedCertEntry(@Nullable KeyStore ignore1, @NonNull String alias, @Nullable char[] ignore2, boolean isServer, @NonNull Map<String,String> attributes, @Nullable Date expiration) throws CouchbaseLiteException- Specified by:
createSelfSignedCertEntryin classKeyStoreManager- Throws:
CouchbaseLiteException
-
deleteEntries
public int deleteEntries(@Nullable KeyStore ignore, @NonNull Fn.Predicate<String> filter) throws CouchbaseLiteException- Specified by:
deleteEntriesin classKeyStoreManager- Throws:
CouchbaseLiteException
-
-