bouncycastle - How can I import a .pfx file that was created without a password? -


i have created pfx pdu using java bouncycastle library. inside pfx pdu, there 2 certificates , 2 encrypted private keys. contents used pkcs#7 data content (i.e. no encryption, stored octet strings).i organised elements according guidelines of pkcs#12 (rfc 7292 section 5). wrote der encoded byte array file.

i opened file in hex editor , saw object structure ok. have read file contents , built bouncycastle pfx object it. when try open .pfx file file system, certificate import wizard asks password private key. did not use password create pfx object. have tried use empty string , password used encrypting private keys, didn't work. shows "the password entered incorrect.".

is there missed here? how can password required import certificates?

in rfc 7292, section 4.1, page 41, details of authenticatedsafe described. autthenticatedsafe sequence of contentinfo 1 of 3 types.

authenticatedsafe ::= sequence of contentinfo -- data if unencrypted -- encrypteddata if password-encrypted -- envelopeddata if public key-encrypted 

make authenticatedsafe data encrypteddata needs encrypt berencoded value of authenticatedsafe secretkey generated password give using secretkeyfactory , pbeparameterspec.

hope that, you. cheers !!!


Comments