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 void
createSelfSignedCertEntry(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.int
deleteEntries(KeyStore ignore, Fn.Predicate<String> filter)
boolean
findAlias(KeyStore ignore, String targetAlias)
void
free(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)
PrivateKey
getKey(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:KeyStoreManager
Provides the _public_ key's raw data, as an ASN.1 DER sequence of [modulus, exponent].- Specified by:
getKeyData
in 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:KeyStoreManager
Uses the private key to generate a signature of input data.- Specified by:
sign
in 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:KeyStoreManager
Decrypts data using the private key.- Specified by:
decrypt
in 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:KeyStoreManager
Called when the C4KeyPair is released and the externalKey is no longer needed and when associated resources may be freed- Specified by:
free
in classKeyStoreManager
- Parameters:
keyPair
- The key pair
-
findAlias
public boolean findAlias(@Nullable KeyStore ignore, @NonNull String targetAlias)
- Specified by:
findAlias
in classKeyStoreManager
-
getKey
@Nullable public PrivateKey getKey(@Nullable KeyStore ignore1, @NonNull String alias, @Nullable char[] ignore2)
- Specified by:
getKey
in classKeyStoreManager
-
getCertificateChain
@Nullable public List<Certificate> getCertificateChain(@Nullable KeyStore ignore, @NonNull String alias)
- Specified by:
getCertificateChain
in 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:
createSelfSignedCertEntry
in classKeyStoreManager
- Throws:
CouchbaseLiteException
-
deleteEntries
public int deleteEntries(@Nullable KeyStore ignore, @NonNull Fn.Predicate<String> filter) throws CouchbaseLiteException
- Specified by:
deleteEntries
in classKeyStoreManager
- Throws:
CouchbaseLiteException
-
-