Hello,
This exception occure when I try to call a webservice with wss4j:
[23/05/05 11:43:17:505 CEST] 729a159b SystemErr R
java.security.NoSuchAlgorithmException: SHA1PRNG SecureRandom not available
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at
java.security.Security.getAlgClassName(Security.java:576)
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at
java.security.Security.getAlgClassName(Security.java:598)
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at
java.security.Security.getImpl(Security.java:1079)
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at
java.security.SecureRandom.getInstance(SecureRandom.java:241)
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at at
org.apache.ws.security.message.token.UsernameToken.<clinit>(UsernameToken.java:69).null(Unknown
Source)
[23/05/05 11:43:17:515 CEST] 729a159b SystemErr R at ...
In fact, SHA1PRNG is not implemented in IBM JRE. The only solution I've got
to make it work is to change wss4j sources ConvertionUtil.java and
UsernameToken.java like this:
SecureRandom random = null;
try {
random = SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e) {
try {
System.out.println("calling SecureRandom.getInstance with
IBMSecureRandom");
random = SecureRandom.getInstance("IBMSecureRandom");
} catch (NoSuchAlgorithmException nsa1) {
System.out.println(nsa1);
}
}
Do you know another way more elegant to do this without changing my jvm?
Thanks,
Benjamin
----------------------------------------------------------
Le pr�sent message ainsi que ses �ventuelles pi�ces jointes est
exclusivement destin� au(x) destinataire(s), personnes physiques ou
morales, qu'il d�signe.
Il constitue de ce fait une correspondance � caract�re priv� et peut
contenir des informations confidentielles.
Si ce message vous est parvenu par erreur, nous vous remercions d'en aviser
imm�diatement l'exp�diteur par retour de courrier �lectronique puis de le
d�truire, ainsi que ses �ventuelles pi�ces jointes, sans en conserver de
copie.
This message, including any attachment, is intended for the use of the
individual or entity to which it is addressed.
It is therefore to be considered as a private correspondence which may
contain confidential information.
If you are not the intended recipient, please advise the sender immediately
by reply e.mail and delete this message and any attachment thereto without
retaining a copy.
----------------------------------------------------------