Additional info ;
after having tried a few test ...
1) when i get the public key from JSS methods, at verifying the
signerinfo, I get the java exception InvalidKeyException :
inconsistent key type
Method to get the key is :
FileInputStream fis = new FileInputStream("cret.crt");
Certificate ocert = (Certificate)
org.mozilla.jss.pkix.cert.Certificate.getTemplate().decode(fis);
java.security.PublicKey pkey2 =
ocert.getInfo().getSubjectPublicKeyInfo().toPublicKey();
whereas when I get the key with other method from sun :
FileInputStream fis = new
FileInputStream(Configuration.get_Cert_Path()+rao+".crt");
CertificateFactory cf = CertificateFactory.getInstance("X.509");
java.security.cert.X509Certificate cert =
(java.security.cert.X509Certificate)
cf.generateCertificate(fis);
java.security.PublicKey pkey = cert.getPublicKey();
I get a java exception ; not pkcs11 key at verifying the signerinfo
(SignerInfo.verify(...))
It is strange : shouldn't the keys be the same ?
When i try to convert to pkcs11 publickey with fromRaw method, I get
an OutOfMemory java exception at
org.mozilla.jss.pkcs11.PK11PubKey.getEncoded(Native Method)
whereas the key where this method is applied is a
java.security.PublicKey ! (pkey2 : methods from JSS used to retrieve
the key)
And when I try fromRaw method with the publickey retrieved with the
second method, I get the error I already described in previous
messages...
Well I become a bit lost....