public static KeyProvider getKeyProvider(Configuration conf) {
    String providerClassName =
      conf.get(HConstants.CRYPTO_KEYPROVIDER_CONF_KEY, KeyStoreKeyProvider.class.getName());
    String providerParameters = conf.get(HConstants.CRYPTO_KEYPROVIDER_PARAMETERS_KEY, "");
    try {
      Pair<String, String> providerCacheKey = new Pair<>(providerClassName, providerParameters);
      KeyProvider provider = keyProviderCache.get(providerCacheKey);
      if (provider != null) {
        return provider;
      }
      provider = (KeyProvider) ReflectionUtils
        .newInstance(getClassLoaderForClass(KeyProvider.class).loadClass(providerClassName), conf);
      provider.init(providerParameters);
      if (LOG.isDebugEnabled()) {
        LOG.debug("Installed " + providerClassName + " into key provider cache");
      }
      keyProviderCache.put(providerCacheKey, provider);
      return provider;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
Decrypts a block of ciphertext with the symmetric key resolved for the given subject
@param out     plaintext
@param in      ciphertext
@param outLen  the expected plaintext length
@param subject the subject's key alias
@param conf    configuration
@param cipher  the encryption algorithm
@param iv      the initialization vector, can be null
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java