use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.
the class TestRangerKeyStore method testInvalidKey1.
@Test(expected = IOException.class)
public void testInvalidKey1() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
DaoManager daoManager = Mockito.mock(DaoManager.class);
RangerKeyStore rangerKeyStore = new RangerKeyStore(daoManager);
String keyValue = "enckey:1";
InputStream inputStream = generateKeyStoreFile(keyValue);
rangerKeyStore.engineLoadKeyStoreFile(inputStream, storePass, keyPass, masterKey, fileFormat);
inputStream.close();
}
use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.
the class TestRangerKeyStore method testInvalidKey2.
@Test(expected = IOException.class)
public void testInvalidKey2() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
DaoManager daoManager = Mockito.mock(DaoManager.class);
RangerKeyStore rangerKeyStore = new RangerKeyStore(daoManager);
String keyValue = "1%enckey";
InputStream inputStream = generateKeyStoreFile(keyValue);
rangerKeyStore.engineLoadKeyStoreFile(inputStream, storePass, keyPass, masterKey, fileFormat);
inputStream.close();
}
use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.
the class TestRangerKeyStore method testValidKey2.
@Test
public void testValidKey2() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
DaoManager daoManager = Mockito.mock(DaoManager.class);
RangerKeyStore rangerKeyStore = new RangerKeyStore(daoManager);
String keyValue = "1-enckey_test";
InputStream inputStream = generateKeyStoreFile(keyValue);
rangerKeyStore.engineLoadKeyStoreFile(inputStream, storePass, keyPass, masterKey, fileFormat);
inputStream.close();
}
use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.
the class TestRangerKeyStore method testValidKey1.
@Test
public void testValidKey1() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
DaoManager daoManager = Mockito.mock(DaoManager.class);
RangerKeyStore rangerKeyStore = new RangerKeyStore(daoManager);
String keyValue = "enckey_1-test";
InputStream inputStream = generateKeyStoreFile(keyValue);
rangerKeyStore.engineLoadKeyStoreFile(inputStream, storePass, keyPass, masterKey, fileFormat);
inputStream.close();
}
use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.
the class TestRangerKeyStore method testInvalidKey3.
@Test(expected = IOException.class)
public void testInvalidKey3() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
DaoManager daoManager = Mockito.mock(DaoManager.class);
RangerKeyStore rangerKeyStore = new RangerKeyStore(daoManager);
String keyValue = "1 enckey";
InputStream inputStream = generateKeyStoreFile(keyValue);
rangerKeyStore.engineLoadKeyStoreFile(inputStream, storePass, keyPass, masterKey, fileFormat);
inputStream.close();
}
Aggregations