I do it because the system i`m developing uses with
java.security.KeyStore too and was standardized to work with
java.security.cert.X509Certificate
The token has two certificates of different AC
When i get the array of org.mozilla.jss.crypto.X509Certificate, the
items are two references of the same certificate
if helps the link bellow is a debug print of the eclipse display of
org.mozilla.jss.crypto.X509Certificate []
http://www.oquefor.xpg.com.br/dbg.jpg
getTokenCertList(PK11Token token){
List<X509Certificate> l = new ArrayList<X509Certificate>();
org.mozilla.jss.crypto.X509Certificate[] cert;
try {
cert = token.getCryptoStore().getCertificates();
} catch (TokenException e) {
throw new CSFExceptionCritica("Pode ter havido uma falha na comunicação
com o token ou o mesmo pode não estar autenticado",
e.getStackTrace());
}
X509Certificate _cert = null;
for (int i = 0; i < cert.length; i++) {
try {
_cert = new X509CertImpl(cert[i].getEncoded());
} catch (CertificateEncodingException e) {
throw new CSFExceptionCritica("Não foi possível capturar o
certificado", e.getStackTrace());
} catch (CertificateException e) {
throw new CSFExceptionCritica("Não foi possível criar um certificado a
partir do array transmitido", e.getStackTrace());
}
l.add(_cert);
}
return l;
}
[EMAIL PROTECTED] escreveu:
Igor,
CryptoStore().getCertificates() returns an array of X509Certificate
available in the store. It is possibility, that you are printing a
reference to the returned array instead of references to certs.
My test code that prints certs from internal cert store works
properly.
Can you please add code that prints/uses returned cert array?
Alexei
Igor Delacroix wrote:
Nelson B escreveu:
Igor Delacroix wrote:
Good Day All,
I have a token with 2 certs, 2 PublicKeys and 2 PrivateKeys
for example cert1 pubk1 privk1
cert2 pubk2 privk2
And I need to show all certificates in a list to user. But the
statement
[code] cert = token.getCryptoStore().getCertificates(); [/code]
Is this Java code? Is this code using JSS? Of what class is the
token object an instance?
Sorry for my dullness,
Yeah is java, i'm using PK11Token from JSS
Returns me only one of the token's certificates repeated two
times
cert1 cert1
is there other way to get token's certificates, that doesn't
return this?
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto