bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

[Question] Creating a PKCS #12 File using AES

Open arvanauk opened this issue 5 years ago • 1 comments

I am trying to create a PKCS #12 file using AES 128. When I create a PKCS #12 file from OpenSSL using AES and print out the structure, I get: PKCS7 PBES2, PBKDF2, AES-128-CDC, Iteration 4096, PRF HMACwithSHA1.

I get errors when I try to set the key and certificate algorithm in the PKCS12StoreBuilder. There are no examples using the PKCS12Store and PKCS12StoreBuilder classes.

I am using version 1.8.6.

arvanauk avatar Mar 28 '20 22:03 arvanauk

I was able to set the key algorithm on the PKCS12StoreBuilder using .SetKeyAlgorithm(NistObjectIdentifiers.IdAes128Cbc, PkcsObjectIdentifiers.IdHmacWithSha1).

The certificate algorithm does not appear to currently support PBES2-based encryption schemes, just the legacy PKCS12 ones.

jonproch117 avatar Feb 14 '23 21:02 jonproch117