Implementation with Provider Bouncy Castle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Implementation with Provider Bouncy Castle

Marcos Vinícius Rubi
Hello

I had some difficulties with a signature with RSA instance Key. Could you please help me to fix the problem? I am using this libs: 
bcmail-jdk16-1.46.jar
bcprov-jdk16-146.jar
 
import org.bouncycastle.jce.provider.BouncyCastleProvider;

Grave:   java.security.InvalidKeyException: Supplied key (null) is not a RSAPrivateKey instance
at org.bouncycastle.jce.provider.JDKDigestSignature.engineInitSign(Unknown Source)
at java.security.Signature$Delegate.engineInitSign(Signature.java:1174)
at java.security.Signature.initSign(Signature.java:527)
at servidor.servlets.SrvSincronia.autorizarPedido(SrvSincronia.java:312)
at servidor.servlets.SrvSincronia.processRequest(SrvSincronia.java:153)
at servidor.servlets.SrvSincronia.doPost(SrvSincronia.java:195)


Marcos



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implementation with Provider Bouncy Castle

David Hook-3

Use 1.57. There is no good reason to be using 1.46 now, but there are plenty of good reasons not to.

The second issue is that it's probably a HSM key.

Regards,

David

On 24/05/17 01:45, Marcos Vinícius Rubi wrote:
Hello

I had some difficulties with a signature with RSA instance Key. Could you please help me to fix the problem? I am using this libs: 
bcmail-jdk16-1.46.jar
bcprov-jdk16-146.jar
 
import org.bouncycastle.jce.provider.BouncyCastleProvider;

Grave:   java.security.InvalidKeyException: Supplied key (null) is not a RSAPrivateKey instance
at org.bouncycastle.jce.provider.JDKDigestSignature.engineInitSign(Unknown Source)
at java.security.Signature$Delegate.engineInitSign(Signature.java:1174)
at java.security.Signature.initSign(Signature.java:527)
at servidor.servlets.SrvSincronia.autorizarPedido(SrvSincronia.java:312)
at servidor.servlets.SrvSincronia.processRequest(SrvSincronia.java:153)
at servidor.servlets.SrvSincronia.doPost(SrvSincronia.java:195)


Marcos




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implementation with Provider Bouncy Castle

Marcos Vinícius Rubi
The second issue is that it's probably a HSM key

Could you explain? I didn't understante very well. I thought that i didn't exported to jks files. Is a problem with the key?

Best regards David.

Marcos






2017-05-23 18:39 GMT-03:00 David Hook <[hidden email]>:

Use 1.57. There is no good reason to be using 1.46 now, but there are plenty of good reasons not to.

The second issue is that it's probably a HSM key.

Regards,

David


On 24/05/17 01:45, Marcos Vinícius Rubi wrote:
Hello

I had some difficulties with a signature with RSA instance Key. Could you please help me to fix the problem? I am using this libs: 
bcmail-jdk16-1.46.jar
bcprov-jdk16-146.jar
 
import org.bouncycastle.jce.provider.BouncyCastleProvider;

Grave:   java.security.InvalidKeyException: Supplied key (null) is not a RSAPrivateKey instance
at org.bouncycastle.jce.provider.JDKDigestSignature.engineInitSign(Unknown Source)
at java.security.Signature$Delegate.engineInitSign(Signature.java:1174)
at java.security.Signature.initSign(Signature.java:527)
at servidor.servlets.SrvSincronia.autorizarPedido(SrvSincronia.java:312)
at servidor.servlets.SrvSincronia.processRequest(SrvSincronia.java:153)
at servidor.servlets.SrvSincronia.doPost(SrvSincronia.java:195)


Marcos





Loading...