import javax.crypto.Cipher;
-import org.onap.aaf.cadi.cm.CertException;
-import org.onap.aaf.cadi.cm.Factory;
-import org.onap.aaf.cadi.cm.Factory.Base64InputStream;
-import org.onap.aaf.cadi.cm.Factory.StripperInputStream;
-
+import org.onap.aaf.cadi.configure.CertException;
+import org.onap.aaf.cadi.configure.Factory;
+import org.onap.aaf.cadi.configure.Factory.Base64InputStream;
+import org.onap.aaf.cadi.configure.Factory.StripperInputStream;
import org.onap.aaf.misc.env.Env;
import org.onap.aaf.misc.env.LogTarget;
import org.onap.aaf.misc.env.TimeTaken;
assertThat(privateKeyString.startsWith("-----BEGIN PRIVATE KEY-----"), is(true));
assertThat(privateKeyString.endsWith("-----END PRIVATE KEY-----\n"), is(true));
- PublicKey publicKey = Factory.toPublicKey(transMock, cleanupString(publicKeyString));
- PrivateKey privateKey = Factory.toPrivateKey(transMock, cleanupString(privateKeyString));
+ PublicKey publicKey = Factory.toPublicKey(transMock, publicKeyString);
+ PrivateKey privateKey = Factory.toPrivateKey(transMock, privateKeyString);
Cipher encryptor = Factory.pkCipher(publicKey, true);
Cipher decryptor = Factory.pkCipher(privateKey, false);
output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]);
assertThat(output, is(certString));
- List<String> certStrings = new ArrayList<String>();
+ List<String> certStrings = new ArrayList<>();
certStrings.add(certString);
certStrings.add(certString);
certs = Factory.toX509Certificate(certStrings);
private String cleanupString(String str) {
String[] lines = str.split("\n", 0);
- List<String> rawLines = new ArrayList<String>();
+ List<String> rawLines = new ArrayList<>();
for (int i = 0; i < lines.length - 2; i++) {
rawLines.add(lines[i + 1]);
}