Class KMSClientProvider

  • All Implemented Interfaces:
    org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension, org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension, org.apache.hadoop.crypto.key.KeyProviderExtension.Extension, org.apache.hadoop.security.token.DelegationTokenIssuer

    @Private
    public class KMSClientProvider
    extends org.apache.hadoop.crypto.key.KeyProvider
    implements org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension, org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension
    KMS client KeyProvider implementation.
    • Constructor Detail

      • KMSClientProvider

        public KMSClientProvider​(URI uri,
                                 org.apache.hadoop.conf.Configuration conf)
                          throws IOException
        Throws:
        IOException
    • Method Detail

      • getDtService

        protected static org.apache.hadoop.io.Text getDtService​(URI uri)
      • getKeyVersion

        public org.apache.hadoop.crypto.key.KeyProvider.KeyVersion getKeyVersion​(String versionName)
                                                                          throws IOException
        Specified by:
        getKeyVersion in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • getCurrentKey

        public org.apache.hadoop.crypto.key.KeyProvider.KeyVersion getCurrentKey​(String name)
                                                                          throws IOException
        Overrides:
        getCurrentKey in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • getKeysMetadata

        public org.apache.hadoop.crypto.key.KeyProvider.Metadata[] getKeysMetadata​(String... keyNames)
                                                                            throws IOException
        Overrides:
        getKeysMetadata in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • createKey

        public org.apache.hadoop.crypto.key.KeyProvider.KeyVersion createKey​(String name,
                                                                             byte[] material,
                                                                             org.apache.hadoop.crypto.key.KeyProvider.Options options)
                                                                      throws IOException
        Specified by:
        createKey in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • invalidateCache

        public void invalidateCache​(String name)
                             throws IOException
        Overrides:
        invalidateCache in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • rollNewVersion

        public org.apache.hadoop.crypto.key.KeyProvider.KeyVersion rollNewVersion​(String name,
                                                                                  byte[] material)
                                                                           throws IOException
        Specified by:
        rollNewVersion in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • decryptEncryptedKey

        public org.apache.hadoop.crypto.key.KeyProvider.KeyVersion decryptEncryptedKey​(org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.EncryptedKeyVersion encryptedKeyVersion)
                                                                                throws IOException,
                                                                                       GeneralSecurityException
        Specified by:
        decryptEncryptedKey in interface org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension
        Throws:
        IOException
        GeneralSecurityException
      • reencryptEncryptedKey

        public org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.EncryptedKeyVersion reencryptEncryptedKey​(org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.EncryptedKeyVersion ekv)
                                                                                                          throws IOException,
                                                                                                                 GeneralSecurityException
        Specified by:
        reencryptEncryptedKey in interface org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension
        Throws:
        IOException
        GeneralSecurityException
      • getKeyVersions

        public List<org.apache.hadoop.crypto.key.KeyProvider.KeyVersion> getKeyVersions​(String name)
                                                                                 throws IOException
        Specified by:
        getKeyVersions in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • getMetadata

        public org.apache.hadoop.crypto.key.KeyProvider.Metadata getMetadata​(String name)
                                                                      throws IOException
        Specified by:
        getMetadata in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • deleteKey

        public void deleteKey​(String name)
                       throws IOException
        Specified by:
        deleteKey in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • flush

        public void flush()
                   throws IOException
        Specified by:
        flush in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException
      • warmUpEncryptedKeys

        public void warmUpEncryptedKeys​(String... keyNames)
                                 throws IOException
        Specified by:
        warmUpEncryptedKeys in interface org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension
        Throws:
        IOException
      • drain

        public void drain​(String keyName)
        Specified by:
        drain in interface org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension
      • getEncKeyQueueSize

        public int getEncKeyQueueSize​(String keyName)
      • setClientTokenProvider

        protected void setClientTokenProvider​(org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension provider)
      • selectDelegationToken

        @Private
        public org.apache.hadoop.security.token.Token<?> selectDelegationToken​(org.apache.hadoop.security.Credentials creds)
        Specified by:
        selectDelegationToken in interface org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension
      • selectDelegationToken

        protected static org.apache.hadoop.security.token.Token<?> selectDelegationToken​(org.apache.hadoop.security.Credentials creds,
                                                                                         org.apache.hadoop.io.Text service)
      • getCanonicalServiceName

        public String getCanonicalServiceName()
        Specified by:
        getCanonicalServiceName in interface org.apache.hadoop.security.token.DelegationTokenIssuer
      • getDelegationToken

        public org.apache.hadoop.security.token.Token<?> getDelegationToken​(String renewer)
                                                                     throws IOException
        Specified by:
        getDelegationToken in interface org.apache.hadoop.security.token.DelegationTokenIssuer
        Throws:
        IOException
      • renewDelegationToken

        public long renewDelegationToken​(org.apache.hadoop.security.token.Token<?> dToken)
                                  throws IOException
        Specified by:
        renewDelegationToken in interface org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension
        Throws:
        IOException
      • cancelDelegationToken

        public Void cancelDelegationToken​(org.apache.hadoop.security.token.Token<?> dToken)
                                   throws IOException
        Specified by:
        cancelDelegationToken in interface org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension
        Throws:
        IOException
      • close

        public void close()
                   throws IOException
        Shutdown valueQueue executor threads
        Overrides:
        close in class org.apache.hadoop.crypto.key.KeyProvider
        Throws:
        IOException