diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-10-14 16:29:46 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-10-14 16:29:46 +0700 |
commit | c1c9c9ad03d363522a0e2ed9b3fead4016f6a01b (patch) | |
tree | 4fb0454345cd9f565935db1f57eb74ad19f7ce4a /crypto/src/pkcs | |
parent | Add Asn1Encodable.EncodeTo methods (diff) | |
download | BouncyCastle.NET-ed25519-c1c9c9ad03d363522a0e2ed9b3fead4016f6a01b.tar.xz |
Some Obsolete cleanup
Diffstat (limited to 'crypto/src/pkcs')
-rw-r--r-- | crypto/src/pkcs/Pkcs12Store.cs | 9 | ||||
-rw-r--r-- | crypto/src/pkcs/Pkcs12Utilities.cs | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs index 2d7de67e6..832367e6b 100644 --- a/crypto/src/pkcs/Pkcs12Store.cs +++ b/crypto/src/pkcs/Pkcs12Store.cs @@ -304,7 +304,7 @@ namespace Org.BouncyCastle.Pkcs foreach (Asn1Sequence subSeq in seq) { - SafeBag b = new SafeBag(subSeq); + SafeBag b = SafeBag.GetInstance(subSeq); if (b.BagID.Equals(PkcsObjectIdentifiers.CertBag)) { @@ -334,7 +334,7 @@ namespace Org.BouncyCastle.Pkcs foreach (SafeBag b in certBags) { - CertBag certBag = new CertBag((Asn1Sequence)b.BagValue); + CertBag certBag = CertBag.GetInstance(b.BagValue); byte[] octets = ((Asn1OctetString)certBag.CertValue).GetOctets(); X509Certificate cert = new X509CertificateParser().ReadCertificate(octets); @@ -1030,10 +1030,7 @@ namespace Org.BouncyCastle.Pkcs // Pfx pfx = new Pfx(mainInfo, macData); - Asn1OutputStream derOut = Asn1OutputStream.Create(stream, - useDerEncoding ? Asn1Encodable.Der : Asn1Encodable.Ber); - - derOut.WriteObject(pfx); + pfx.EncodeTo(stream, useDerEncoding ? Asn1Encodable.Der : Asn1Encodable.Ber); } internal static byte[] CalculatePbeMac( diff --git a/crypto/src/pkcs/Pkcs12Utilities.cs b/crypto/src/pkcs/Pkcs12Utilities.cs index 923eca5a5..2fbb82de5 100644 --- a/crypto/src/pkcs/Pkcs12Utilities.cs +++ b/crypto/src/pkcs/Pkcs12Utilities.cs @@ -22,7 +22,7 @@ namespace Org.BouncyCastle.Pkcs public static byte[] ConvertToDefiniteLength( byte[] berPkcs12File) { - Pfx pfx = new Pfx(Asn1Sequence.GetInstance(Asn1Object.FromByteArray(berPkcs12File))); + Pfx pfx = Pfx.GetInstance(berPkcs12File); return pfx.GetEncoded(Asn1Encodable.Der); } @@ -40,7 +40,7 @@ namespace Org.BouncyCastle.Pkcs byte[] berPkcs12File, char[] passwd) { - Pfx pfx = new Pfx(Asn1Sequence.GetInstance(Asn1Object.FromByteArray(berPkcs12File))); + Pfx pfx = Pfx.GetInstance(berPkcs12File); ContentInfo info = pfx.AuthSafe; |