.setMaxVersions(4).setEncryptionType(algorithm).setEncryptionKey(EncryptionUtil .wrapKey(conf, conf.get(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY, User.getCurrent().getShortName()), cfKey)).build();
byte[] keyBytes = new byte[cipher.getKeyLength()]; new SecureRandom().nextBytes(keyBytes); columnDescBuilder.setEncryptionType(cipher.getName()); columnDescBuilder.setEncryptionKey( EncryptionUtil.wrapKey(conf,
@Before @Override public void setUp() throws Exception { // Initialize the cluster. This invokes LoadTestTool -init_only, which // will create the test table, appropriately pre-split super.setUp(); if (!initialized) { return; } // Update the test table schema so HFiles from this point will be written with // encryption features enabled. final Admin admin = util.getAdmin(); TableDescriptor tableDescriptor = admin.getDescriptor(getTablename()); for (ColumnFamilyDescriptor columnDescriptor : tableDescriptor.getColumnFamilies()) { ColumnFamilyDescriptor updatedColumn = ColumnFamilyDescriptorBuilder .newBuilder(columnDescriptor).setEncryptionType("AES").build(); LOG.info( "Updating CF schema for " + getTablename() + "." + columnDescriptor.getNameAsString()); admin.disableTable(getTablename()); admin.modifyColumnFamily(getTablename(), updatedColumn); admin.enableTable(getTablename()); util.waitFor(30000, 1000, true, new Predicate<IOException>() { @Override public boolean evaluate() throws IOException { return admin.isTableAvailable(getTablename()); } }); } }
byte[] keyBytes = new byte[cipher.getKeyLength()]; new SecureRandom().nextBytes(keyBytes); columnDescBuilder.setEncryptionType(cipher.getName()); columnDescBuilder.setEncryptionKey( EncryptionUtil.wrapKey(conf,
byte[] keyBytes = new byte[cipher.getKeyLength()]; new SecureRandom().nextBytes(keyBytes); columnDescBuilder.setEncryptionType(cipher.getName()); columnDescBuilder.setEncryptionKey( EncryptionUtil.wrapKey(conf,
@Before @Override public void setUp() throws Exception { // Initialize the cluster. This invokes LoadTestTool -init_only, which // will create the test table, appropriately pre-split super.setUp(); if (!initialized) { return; } // Update the test table schema so HFiles from this point will be written with // encryption features enabled. final Admin admin = util.getAdmin(); TableDescriptor tableDescriptor = admin.getDescriptor(getTablename()); for (ColumnFamilyDescriptor columnDescriptor : tableDescriptor.getColumnFamilies()) { ColumnFamilyDescriptor updatedColumn = ColumnFamilyDescriptorBuilder .newBuilder(columnDescriptor).setEncryptionType("AES").build(); LOG.info( "Updating CF schema for " + getTablename() + "." + columnDescriptor.getNameAsString()); admin.disableTable(getTablename()); admin.modifyColumnFamily(getTablename(), updatedColumn); admin.enableTable(getTablename()); util.waitFor(30000, 1000, true, new Predicate<IOException>() { @Override public boolean evaluate() throws IOException { return admin.isTableAvailable(getTablename()); } }); } }