Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AES support for PKCS12StoreBuilder #596

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto/src/pkcs/Pkcs12Store.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ public void Save(Stream stream, char[] password, SecureRandom random)

Asn1EncodableVector certBags = new Asn1EncodableVector(m_keys.Count);
Pkcs12PbeParams cParams = new Pkcs12PbeParams(cSalt, MinIterations);
AlgorithmIdentifier cAlgId = new AlgorithmIdentifier(certAlgorithm, cParams.ToAsn1Object());
var doneCerts = new HashSet<X509Certificate>();

for (uint i = reverseCertificates ? (uint)m_keysOrder.Count-1 : 0;
Expand Down Expand Up @@ -931,6 +930,7 @@ public void Save(Stream stream, char[] password, SecureRandom random)
}
else
{
AlgorithmIdentifier cAlgId = new AlgorithmIdentifier(certAlgorithm, cParams.ToAsn1Object());
byte[] certBytes = CryptPbeData(true, cAlgId, password, false, certBagsEncoding);
EncryptedData cInfo = new EncryptedData(PkcsObjectIdentifiers.Data, cAlgId, new BerOctetString(certBytes));
certsInfo = new ContentInfo(PkcsObjectIdentifiers.EncryptedData, cInfo.ToAsn1Object());
Expand Down
Loading