Class KeyStoreManagerDelegate

    • 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 class KeyStoreManager
        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 class KeyStoreManager
        Parameters:
        keyPair - The key pair
        digestAlgorithm - 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 class KeyStoreManager
        Parameters:
        keyPair - The key pair
        data - 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 class KeyStoreManager
        Parameters:
        keyPair - The key pair
      • findAlias

        public boolean findAlias​(@Nullable
                                 java.security.KeyStore ignore,
                                 @NonNull
                                 java.lang.String targetAlias)
        Specified by:
        findAlias in class KeyStoreManager
      • getKey

        @Nullable
        public java.security.PrivateKey getKey​(@Nullable
                                               java.security.KeyStore ignore1,
                                               @NonNull
                                               java.lang.String alias,
                                               @Nullable
                                               char[] ignore2)
        Specified by:
        getKey in class KeyStoreManager
      • getCertificateChain

        @Nullable
        public java.util.List<java.security.cert.Certificate> getCertificateChain​(@Nullable
                                                                                  java.security.KeyStore ignore,
                                                                                  @NonNull
                                                                                  java.lang.String alias)
        Specified by:
        getCertificateChain in class KeyStoreManager
      • createSelfSignedCertEntry

        public void createSelfSignedCertEntry​(@Nullable
                                              java.security.KeyStore ignore1,
                                              @NonNull
                                              java.lang.String alias,
                                              @Nullable
                                              char[] ignore2,
                                              boolean isServer,
                                              @NonNull
                                              java.util.Map<java.lang.String,​java.lang.String> attributes,
                                              @Nullable
                                              java.util.Date expiration)
                                       throws CouchbaseLiteException
        Specified by:
        createSelfSignedCertEntry in class KeyStoreManager
        Throws:
        CouchbaseLiteException