You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Dittmann Werner <we...@siemens.com> on 2005/05/25 13:32:57 UTC

AW: NoSuchAlgorithmException: SHA1PRNG SecureRandom - on Webspher e 5.2.1 - J2EE 1.3

Benjamin,

not at the moment. Maybe we can have a look into BouncyCastel
if they provide such a beast. Because we use BouncyCastle
anyway we might look there.

Regards,
Werner

> -----Ursprüngliche Nachricht-----
> Von: Benjamin.Francioni@sanofi-aventis.com 
> [mailto:Benjamin.Francioni@sanofi-aventis.com] 
> Gesendet: Mittwoch, 25. Mai 2005 12:43
> An: fx-dev@ws.apache.org
> Betreff: NoSuchAlgorithmException: SHA1PRNG SecureRandom - on 
> Websphere 5.2.1 - J2EE 1.3
> 
> 
> 
> 
> 
> 
> 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>(Us
> ernameToken.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.
> ----------------------------------------------------------
>