public static Key getSecretKeyForSubject(String subject, Configuration conf) throws IOException {
    KeyProvider provider = getKeyProvider(conf);
    if (provider != null) {
      try {
        Key[] keys = provider.getKeys(new String[] { subject });
        if (keys != null && keys.length > 0) {
          return keys[0];
        }
      } catch (Exception e) {
        throw new IOException(e);
      }
    }
    throw new IOException("No key found for subject '" + subject + "'");
  }
Resolves a key for the given subject
@return a key for the given subject
@throws IOException if the key is not found
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java