Java Code Examples for org.apache.hadoop.crypto.key.KeyProvider#Options

The following examples show how to use org.apache.hadoop.crypto.key.KeyProvider#Options . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestOzoneAtRestEncryption.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
private static void createKey(String keyName, KeyProvider
    provider, OzoneConfiguration config)
    throws NoSuchAlgorithmException, IOException {
  final KeyProvider.Options options = KeyProvider.options(config);
  options.setDescription(keyName);
  options.setBitLength(128);
  provider.createKey(keyName, options);
  provider.flush();
}
 
Example 2
Source File: TestCryptoAdminCLI.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void createAKey(String keyName, Configuration conf)
throws NoSuchAlgorithmException, IOException {
final KeyProvider provider =
    dfsCluster.getNameNode().getNamesystem().getProvider();
final KeyProvider.Options options = KeyProvider.options(conf);
provider.createKey(keyName, options);
provider.flush();
}
 
Example 3
Source File: DFSTestUtil.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Helper function to create a key in the Key Provider.
 *
 * @param keyName The name of the key to create
 * @param cluster The cluster to create it in
 * @param idx The NameNode index
 * @param conf Configuration to use
 */
public static void createKey(String keyName, MiniDFSCluster cluster,
                             int idx, Configuration conf)
    throws NoSuchAlgorithmException, IOException {
  NameNode nn = cluster.getNameNode(idx);
  KeyProvider provider = nn.getNamesystem().getProvider();
  final KeyProvider.Options options = KeyProvider.options(conf);
  options.setDescription(keyName);
  options.setBitLength(128);
  provider.createKey(keyName, options);
  provider.flush();
}
 
Example 4
Source File: TestCryptoAdminCLI.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void createAKey(String keyName, Configuration conf)
throws NoSuchAlgorithmException, IOException {
final KeyProvider provider =
    dfsCluster.getNameNode().getNamesystem().getProvider();
final KeyProvider.Options options = KeyProvider.options(conf);
provider.createKey(keyName, options);
provider.flush();
}
 
Example 5
Source File: DFSTestUtil.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Helper function to create a key in the Key Provider.
 *
 * @param keyName The name of the key to create
 * @param cluster The cluster to create it in
 * @param idx The NameNode index
 * @param conf Configuration to use
 */
public static void createKey(String keyName, MiniDFSCluster cluster,
                             int idx, Configuration conf)
    throws NoSuchAlgorithmException, IOException {
  NameNode nn = cluster.getNameNode(idx);
  KeyProvider provider = nn.getNamesystem().getProvider();
  final KeyProvider.Options options = KeyProvider.options(conf);
  options.setDescription(keyName);
  options.setBitLength(128);
  provider.createKey(keyName, options);
  provider.flush();
}
 
Example 6
Source File: TestKeyAuthorizationKeyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private static KeyProvider.Options newOptions(Configuration conf) {
  KeyProvider.Options options = new KeyProvider.Options(conf);
  options.setCipher(CIPHER);
  options.setBitLength(128);
  return options;
}
 
Example 7
Source File: TestKeyAuthorizationKeyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
private static KeyProvider.Options newOptions(Configuration conf) {
  KeyProvider.Options options = new KeyProvider.Options(conf);
  options.setCipher(CIPHER);
  options.setBitLength(128);
  return options;
}
 
Example 8
Source File: TestKeyAuthorizationKeyProvider.java    From ranger with Apache License 2.0 4 votes vote down vote up
private static KeyProvider.Options newOptions(Configuration conf) {
  KeyProvider.Options options = new KeyProvider.Options(conf);
  options.setCipher(CIPHER);
  options.setBitLength(128);
  return options;
}