You can cast a java.security.cert.Certificate to
java.security.cert.X509Certificate and it will work.
Another way of solving this problem, and which may be a
little simpler IMHO, is to use the KeyStore class from
the standard JDK, and combine it with the SunPKCS11 Bridge
to gain access to the NSS cert-store (the config files and
source code in StrongKey - specifically, the
keystoreLoaderHelper.java file - provide examples).
The advantage is that the developer only needs to write
to one API (JDK), but still leverages the benefits of using
other crypto libraries (NSS, BC, etc.) where desired. Of
course, if the JDK does not provide what you need then you
still need to go to the non-JDK API - but we've managed to
stay within the JDK API and work with 5 different crypto
providers through the Bridge, so far.
Arshad Noor
StrongAuth, Inc.
Primo It wrote:
It doesn't work.
I can`t pass a Certificate to importCertToPerm that receives X509Certificate
"Glen Beasley" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
Primo It wrote:
Hi,
I`m trying to do it too.
I want to insert a certificate (a file *.cer selected in the machine)
into the Permanent Certificates DB by the
CryptoManager.importCertToPerm(...), but for it, i need to create an
instance of org.mozilla.jss.crypto.X509Certificate from this selected
file.
is there a way to do it?
http://www.mozilla.org/projects/security/pki/jss/faq.html
*How do I convert org.mozilla.jss.crypto.X509Certificate to
org.mozilla.jss.pkix.cert.Certificate?*
import java.io.ByteArrayInputStream;
[...]
Certificate cert = (Certificate) ASN1Util.decode(
Certificate.getTemplate(),x509Cert.getEncoded() );
http://lxr.mozilla.org/mozilla/source/security/jss/org/mozilla/jss/tests
somehow like the CertificateFactory from the Sun
CertificateFactory cf = CertificateFactory.getInstance("X.509");
cert = (X509Certificate) cf.generateCertificate (new FileInputStream(new
File("c:/teste.cer")));
"shinigami" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
http://lxr.mozilla.org/mozilla/source/security/jss/org/mozilla/jss/tests/VerifyCert.java
-glen
Hi,
E want install a cert in a db. But my cert when i receive from outside
is a java.security.cert.X509Certificate, and the method importCertToPerm
can“t do it. I need to cast this cert to
org.mozilla.jss.crypto.X509Certificate. Or exist other way to do this??
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto