Class SdkmsKeyStore


  • public final class SdkmsKeyStore
    extends KeyStore
    • Constructor Summary

      Constructors 
      Constructor Description
      SdkmsKeyStore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration<java.lang.String> engineAliases()
      Lists all the alias names of this keystore.
      boolean engineContainsAlias​(java.lang.String alias)  
      void engineDeleteEntry​(java.lang.String alias)
      Deletes the entry from sdkms
      java.lang.String engineGetCertificateAlias​(java.security.cert.Certificate cert)  
      java.security.cert.Certificate[] engineGetCertificateChain​(java.lang.String alias)
      Throw an exception as we do not store certificate chain.
      java.util.Date engineGetCreationDate​(java.lang.String alias)  
      java.security.Key engineGetKey​(java.lang.String name, char[] password)
      Returns the key associated with the given alias, using the given password to recover it.
      boolean engineIsCertificateEntry​(java.lang.String alias)  
      boolean engineIsKeyEntry​(java.lang.String alias)  
      void engineLoad​(java.io.InputStream stream, char[] password)
      Loads the groupid from the given input stream.
      void engineSetCertificateEntry​(java.lang.String alias, java.security.cert.Certificate cert)  
      void engineSetKeyEntry​(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain)  
      int engineSize()
      throw exception as we do not get the size from sdkms.
      void engineStore​(java.io.OutputStream stream, char[] password)
      No need to storing the keys as it is managed by sdkms.
      • Methods inherited from class java.security.KeyStoreSpi

        engineEntryInstanceOf, engineGetEntry, engineLoad, engineProbe, engineSetEntry, engineStore
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SdkmsKeyStore

        public SdkmsKeyStore()
    • Method Detail

      • engineLoad

        public void engineLoad​(java.io.InputStream stream,
                               char[] password)
                        throws java.io.IOException
        Loads the groupid from the given input stream.
        Specified by:
        engineLoad in class KeyStore
        Parameters:
        stream - the input stream from which the groupid is loaded
        password - the (optional) password
        Throws:
        java.io.IOException - if there is an I/O or format problem with string
      • engineStore

        public void engineStore​(java.io.OutputStream stream,
                                char[] password)
                         throws java.io.IOException
        No need to storing the keys as it is managed by sdkms.
        Specified by:
        engineStore in class KeyStore
        Throws:
        java.io.IOException
      • engineAliases

        public java.util.Enumeration<java.lang.String> engineAliases()
        Lists all the alias names of this keystore.
        Specified by:
        engineAliases in class KeyStore
        Returns:
        enumeration of the alias names
      • engineGetCertificateChain

        public java.security.cert.Certificate[] engineGetCertificateChain​(java.lang.String alias)
        Throw an exception as we do not store certificate chain.
        Specified by:
        engineGetCertificateChain in class KeyStore
      • engineGetCreationDate

        public java.util.Date engineGetCreationDate​(java.lang.String alias)
        Specified by:
        engineGetCreationDate in class KeyStore
      • engineGetKey

        public java.security.Key engineGetKey​(java.lang.String name,
                                              char[] password)
                                       throws java.security.NoSuchAlgorithmException,
                                              java.security.UnrecoverableKeyException
        Returns the key associated with the given alias, using the given password to recover it.
        Specified by:
        engineGetKey in class KeyStore
        Parameters:
        name - the alias name
        password - : always null
        Returns:
        the requested key, or null if the given alias does not exist or does not identify a key entry.
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.UnrecoverableKeyException
      • engineSetKeyEntry

        public void engineSetKeyEntry​(java.lang.String alias,
                                      java.security.Key key,
                                      char[] password,
                                      java.security.cert.Certificate[] chain)
                               throws java.security.KeyStoreException
        Specified by:
        engineSetKeyEntry in class KeyStore
        Throws:
        java.security.KeyStoreException
      • engineDeleteEntry

        public void engineDeleteEntry​(java.lang.String alias)
                               throws java.security.KeyStoreException
        Deletes the entry from sdkms
        Specified by:
        engineDeleteEntry in class KeyStore
        Throws:
        java.security.KeyStoreException
      • engineContainsAlias

        public boolean engineContainsAlias​(java.lang.String alias)
        Specified by:
        engineContainsAlias in class java.security.KeyStoreSpi
      • engineSize

        public int engineSize()
        throw exception as we do not get the size from sdkms.
        Specified by:
        engineSize in class KeyStore
      • engineIsKeyEntry

        public boolean engineIsKeyEntry​(java.lang.String alias)
        Specified by:
        engineIsKeyEntry in class KeyStore
      • engineGetCertificateAlias

        public java.lang.String engineGetCertificateAlias​(java.security.cert.Certificate cert)
        Specified by:
        engineGetCertificateAlias in class KeyStore
      • engineSetCertificateEntry

        public void engineSetCertificateEntry​(java.lang.String alias,
                                              java.security.cert.Certificate cert)
        Specified by:
        engineSetCertificateEntry in class KeyStore