Search in sources :

Example 6 with RangerKeyStore

use of org.apache.hadoop.crypto.key.RangerKeyStore in project ranger by apache.

the class TestRangerKeyStore method testInvalidKey4.

@Test(expected = IOException.class)
public void testInvalidKey4() 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();
}
Also used : FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) RangerKeyStore(org.apache.hadoop.crypto.key.RangerKeyStore) DaoManager(org.apache.ranger.kms.dao.DaoManager) Test(org.junit.Test)

Aggregations

FileInputStream (java.io.FileInputStream)6 InputStream (java.io.InputStream)6 RangerKeyStore (org.apache.hadoop.crypto.key.RangerKeyStore)6 DaoManager (org.apache.ranger.kms.dao.DaoManager)6 Test (org.junit.Test)6