Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

get private key problem

[es] :: Java :: get private key problem

[ Pregleda: 3054 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Shimmy
Miroslav Rankovic
Hermes SoftLab
Obrenovac

Član broj: 1175
Poruke: 7
*.hermes.si

ICQ: 17423796


Profil

icon get private key problem03.07.2003. u 16:51 - pre 224 meseci
I jos nesto. :)

Zasto mi opet baca ObjectNotFoundException pri pozivu na funkciju privateKey = manager.findPrivKeyByCert(javaCert)
a javaCert mi je ispravan parametar ??? Kako drugacije da dobijem private key ??

try
{
CryptoManager manager = CryptoManager.getInstance();
CryptoToken acToken = manager.getTokenByName("Internal Key Storage Token");
System.out.println("IsLoggedIn " + acToken.isLoggedIn());
manager.setThreadToken(acToken);

CryptoStore store = acToken.getCryptoStore();
org.mozilla.jss.crypto.X509Certificate[] certArr = store.getCertificates();

byte[] derCert = certArr[0].getEncoded();
Certificate certe = (Certificate) ASN1Util.decode(Certificate.getTemplate(), derCert);
Name issuerName = certe.getInfo().getIssuer();
byte[] derIssuer = ASN1Util.encode(issuerName);
byte[] derSerial = certArr[0].getSerialNumber().toByteArray();
INTEGER intSN = new INTEGER(derSerial);


org.mozilla.jss.crypto.X509Certificate javaCert = null;
javaCert = manager.findCertByIssuerAndSerialNumber(derIssuer, intSN);

org.mozilla.jss.crypto.PrivateKey privateKey = null;
privateKey = manager.findPrivKeyByCert(javaCert);

}catch(Exception e){
System.out.println(e);
}
Best Regards,
Shimmy !
 
Odgovor na temu

[es] :: Java :: get private key problem

[ Pregleda: 3054 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.