use of co.cask.cdap.api.security.store.SecureStoreData in project cdap by caskdata.
the class FileSecureStoreTest method testGet.
@Test
public void testGet() throws Exception {
populateStore();
SecureStoreMetadata metadata = SecureStoreMetadata.of(KEY1, DESCRIPTION1, PROPERTIES_1);
SecureStoreData secureStoreData = new SecureStoreData(metadata, VALUE1.getBytes(Charsets.UTF_8));
Assert.assertArrayEquals(secureStoreData.get(), secureStore.getSecureData(NAMESPACE1, KEY1).get());
Assert.assertEquals(metadata.getDescription(), secureStore.getSecureData(NAMESPACE1, KEY1).getMetadata().getDescription());
Assert.assertEquals(metadata.getName(), secureStore.getSecureData(NAMESPACE1, KEY1).getMetadata().getName());
}
use of co.cask.cdap.api.security.store.SecureStoreData in project cdap by caskdata.
the class KeyStoreEntry method readObject.
private void readObject(ObjectInputStream in) throws IOException {
byte[] buf = new byte[in.readInt()];
in.readFully(buf);
byte[] dataBuf = new byte[in.readInt()];
in.readFully(dataBuf);
metadata = deserializeMetadata(buf);
data = new SecureStoreData(metadata, dataBuf);
}
Aggregations