- // TODO: Ian - finish these tests
- // @Test
- // public void base64ISTest() throws Exception {
- // KeyPair kp = Factory.generateKeyPair(transMock);
-
- // String privateKeyString = Factory.toString(transMock, kp.getPrivate());
- // String cleaned = cleanupString(privateKeyString);
- // System.out.println(cleaned);
- // writeToFile(privateKeyFile, cleaned);
- // Base64InputStream b64is = new Base64InputStream(privateKeyFile);
- // byte[] buffer = new byte[10000];
- // b64is.read(buffer);
- // System.out.println(new String(buffer));
- // b64is.close();
- // }
-
- // @Test
- // public void getSecurityProviderTest() {
- // }
+ @Test
+ public void base64ISTest() throws Exception {
+ KeyPair kp = Factory.generateKeyPair(transMock);
+
+ String privateKeyString = Factory.toString(transMock, kp.getPrivate());
+ String cleaned = cleanupString(privateKeyString);
+ writeToFile(privateKeyFile, cleaned, null);
+ Base64InputStream b64is = new Base64InputStream(privateKeyFile);
+ byte[] buffer = new byte[10000];
+ b64is.read(buffer);
+ b64is.close();
+
+ FileInputStream fis = new FileInputStream(privateKeyFile);
+ b64is = new Base64InputStream(fis);
+ b64is.close();
+ fis.close();
+ }
+
+ @Test
+ public void getSecurityProviderTest() throws CertException {
+ String[][] params = {
+ {"test", "test"},
+ {"test", "test"},
+ };
+ assertThat(Factory.getSecurityProvider("PKCS12", params), is(nullValue()));
+ }