on 04-17-2006 4:33 PM
We are using Equifax as our certificate provider. I imported the root certificate for Equifax into our TrustedCA view successfully using KEYSTORE service. The algorithm of Equifax is sha1WithRSAENcryption.
We are running AIX, Netweaver 2004 SP13.
When trying to import a private key, using PKCS12 (.p12) I get an error Not a PKCS#8 formatted key.Public Key algorithm not implemented:PKCS#7 data.
I tried PKCS8 and Key formats but nothing seems to work. The ceritifcate itself is fine but not the Private Key.
I had a similar problem with a CA created on Microsoft. The way I resolved it was to create a java program to read the certificate in and save the key as a .p8 file.
Download the freeware java bouncycastle security provider.
public class ConvertP12 {
public static void main(String[] args) {
try {
Security.addProvider(new BouncyCastleProvider());
KeyStore keyStore = KeyStore.getInstance("PKCS12", "BC");
InputStream fs = new FileInputStream("e:/tmp/External.pfx");
String password="xxxx";
keyStore.load(fs, password.toCharArray());
Enumeration enum=keyStore.aliases();
while (enum.hasMoreElements()) {
Object elem= enum.nextElement();
System.out.println(elem.getClass()":"elem.toString());
String alias = (String) elem;
Key key=keyStore.getKey(alias, password.toCharArray());
System.out.println("Algorythm:"+key.getAlgorithm());
System.out.print("Key Format:"+ key.getFormat());
byte[] source=key.getEncoded();
OutputStream out = new FileOutputStream("e:/tmp/External.p8");
out.write(source);
out.close();
}
} catch (KeyStoreException e) {
e.printStackTrace();
} catch (NoSuchProviderException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (CertificateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (UnrecoverableKeyException e) {
e.printStackTrace();
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.