[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-crypto
Subject:    Error decrypting EncryptedPrivateKeyInfo
From:       Javier Arrieta <jarrieta () saicar ! es>
Date:       2003-04-08 9:16:36
[Download RAW message or body]

I'm unable to get the Private key form the cert db

I've tried to decrypt the EncryptedPrivateKeyInfo object, but an 
exception is thrown

     byte[] privData =
       ((TokenCertificate) mozCert)
         .getOwningToken()
         .getCryptoStore()
         .getEncryptedPrivateKeyInfo(
           mozCert,
           PBEAlgorithm.PBE_MD5_DES_CBC,
           new Password("hello".toCharArray()),
           100);

     org.mozilla.jss.pkix.primitive.EncryptedPrivateKeyInfo epiMozilla =
     	(org.mozilla.jss.pkix.primitive.EncryptedPrivateKeyInfo)
         ASN1Util.decode( 
org.mozilla.jss.pkix.primitive.EncryptedPrivateKeyInfo.getTemplate(),
     				 privData );
     				
     PrivateKeyInfo pInfo = epiMozilla.decrypt( new 
Password("hello".toCharArray()) , new PasswordConverter() );
     				

The exception is (but it varies depending on the PBEAlgorithm used

org.mozilla.jss.crypto.BadPaddingException: Padding octet is less than 1

I've tried also to decrypt it with BouncyCastle toolkit and IAIK with 
the same results.

People in BouncyCastle examined the EncryptedPrivateKeyInfo encoded data 
and it seemed somehow garbled

Any ideas/suggestions?

Best regards


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic