List of usage examples for org.apache.hadoop.hdfs.security.token.block DataEncryptionKey DataEncryptionKey
public DataEncryptionKey(int keyId, String blockPoolId, byte[] nonce, byte[] encryptionKey, long expiryDate, String encryptionAlgorithm)
From source file:io.hops.metadata.security.token.block.NameNodeBlockTokenSecretManager.java
License:Apache License
@Override public DataEncryptionKey generateDataEncryptionKey() throws IOException { byte[] nonce = new byte[8]; nonceGenerator.nextBytes(nonce);/*from www . ja v a 2 s . c o m*/ BlockKey key = getBlockKeyByType(BlockKey.KeyType.CurrKey); byte[] encryptionKey = createPassword(nonce, key.getKey()); return new DataEncryptionKey(key.getKeyId(), blockPoolId, nonce, encryptionKey, Time.now() + tokenLifetime, encryptionAlgorithm); }