BALDWIN, ALAN J [AG-Contractor/1000] schrieb am 03/25/2005 10:23 PM:
...key generation code...

    Security.addProvider(new com.sun.crypto.provider.SunJCE());

    KeyGenerator kg = KeyGenerator.getInstance("AES");

    Key key = kg.generateKey();

KeyStore ks = KeyStore.getInstance("jks");
ks.load(null,"security".toCharArray());
ks.setKeyEntry("ecms",key,"security".toCharArray(), null);
ks.store(new FileOutputStream("ecms.jks"), "security".toCharArray());



...my crypto.properties file...

org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=security
org.apache.ws.security.crypto.merlin.keystore.alias=ecms
org.apache.ws.security.crypto.merlin.alias.password=security
org.apache.ws.security.crypto.merlin.file=ecms.jks


...stack trace...

2005-03-25 13:59:14 INFO  [org.apache.ws.security.components.crypto.CryptoFactory] - 
<Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]>
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:612)
        at java.security.KeyStore.load(KeyStore.java:652)
        at org.apache.ws.security.components.crypto.Merlin.load(Merlin.java:524)
        at 
org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:116)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
......
......
Caused by: org.apache.ws.security.components.crypto.CredentialException: Failed 
to load credentials. Inner Exception: [Invalid keystore format]
        at org.apache.ws.security.components.crypto.Merlin.load(Merlin.java:527)
        at 
org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:116)
        ... 43 more





can you read the keystore using keytool? I noticed that keystore that gave me errors when processed wtih keytools didn't work with wss4j either.


tht
Martin

Reply via email to