santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40826] - Private keys must be instance of RSAPrivate or have PKCS#8 encoding
Date Sat, 28 Oct 2006 21:28:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40826>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40826





------- Additional Comments From fillipelima@gmail.com  2006-10-28 14:28 -------
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > The complete stack trace:
> > > 
> > > AssinaturaXMLException: java.security.InvalidKeyException: Private keys 
> must be 
> > > instance of RSAPrivate(Crt)Key or have PKCS#8 encoding
> > > 	at AssinaturaXMLEnveloped.assinar(AssinaturaXMLEnveloped.java:86)
> > This stack trace doesn't help. The AssinaturaXMLException is swallowing the
> > stack trace of the cause: InvalidKeyException. I need to have that the stack
> > trace of the InvalidKeyException to be able to help.
> 
> Ok. I think this may help:
> 
> javax.xml.crypto.dsig.XMLSignatureException: java.security.InvalidKeyException: 
> Private keys must be instance of RSAPrivate(Crt)Key or have PKCS#8 encoding

Hello

I solved the problem just changing the way i get the instance of the KeyStore: 
It was: "this.repositorio = KeyStore.getInstance("PKCS11", provider);"
Now is: "this.repositorio = KeyStore.getInstance("PKCS11");"
I singed the xml many times, without closing the application and itīs is working
fine now.

But i still have some doubts....

1) If i use KeyStore.getInstance("PKCS11", provider) The Exception doesnt occurs
 at the first time and the xml document is signed normally. However, i if try to
sign again, the exception occurs. why ? is it a Bug ?

2) Whatīs the difference between each one? When use each one ?

Tks

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message