public class C4KeyPair extends C4NativePeer implements Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
C4KeyPair.NativeImpl |
accumulateAndGet, addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, incrementAndGet, intValue, lazySet, longValue, set, updateAndGet, weakCompareAndSet
byteValue, shortValue
public static C4KeyPair createKeyPair(@Nullable KeyStore keyStore, @NonNull String keyAlias, @Nullable char[] keyPassword, @NonNull KeyStoreManager.KeyAlgorithm algorithm, KeyStoreManager.KeySize keySize) throws CouchbaseLiteException
keyStore
- the KeyStore object containing the cert and key pairkeyAlias
- the alias by which the key is known to the keystorekeyPassword
- the password protecting the keyalgorithm
- key algorithm (must be KeyManager.KeyAlgorithm.RSA)keySize
- key sizeCouchbaseLiteException
- on errorpublic static C4KeyPair createKeyPair(@Nullable KeyStore keyStore, @NonNull String keyAlias, @Nullable char[] keyPassword, @NonNull KeyStoreManager.KeyAlgorithm algorithm, KeyStoreManager.KeySize keySize, @Nullable KeyPair keys) throws CouchbaseLiteException
keyStore
- the KeyStore object containing the cert and key pairkeyAlias
- the alias by which the key is known to the keystorekeyPassword
- the password protecting the keyalgorithm
- key algorithm (must be KeyManager.KeyAlgorithm.RSA)keySize
- key sizekeys
- keyPair for the case that the KeyPair hasn't been saved into the KeyStoreCouchbaseLiteException
- on errorpublic static C4KeyPair createKeyPair(@NonNull String keyAlias, @NonNull KeyStoreManager.KeyAlgorithm algorithm, KeyStoreManager.KeySize keySize) throws CouchbaseLiteException
keyAlias
- the alias by which the key is known to the keystorealgorithm
- key algorithm (must be KeyManager.KeyAlgorithm.RSA)keySize
- key sizeCouchbaseLiteException
- on error@Nullable public KeyStore getKeyStore()
@NonNull public String getKeyAlias()
@Nullable public char[] getKeyPassword()
@Nullable public KeyPair getKeys()
@NonNull public byte[] generateSelfSignedCertificate(@NonNull KeyStoreManager.KeyAlgorithm algorithm, KeyStoreManager.KeySize keySize, @NonNull Map<String,String> attributes, @NonNull KeyStoreManager.CertUsage usage, long expSecond) throws CouchbaseLiteException
CouchbaseLiteException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
@NonNull public String toString()
toString
in class AtomicLong