From b31a21061c5a42bc4325a911bcc18169feaddbbf Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 14 Oct 2021 16:29:14 +0700 Subject: Add Asn1Encodable.EncodeTo methods --- crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs | 2 +- crypto/test/src/asn1/test/MiscTest.cs | 2 +- crypto/test/src/asn1/test/X509NameTest.cs | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'crypto/test') diff --git a/crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs b/crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs index 91329fbd5..8109d656a 100644 --- a/crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs +++ b/crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs @@ -51,7 +51,7 @@ namespace Org.BouncyCastle.Asn1.Tests }; MemoryStream bOut = new MemoryStream(); - Asn1OutputStream aOut = new Asn1OutputStream(bOut); + Asn1OutputStream aOut = Asn1OutputStream.Create(bOut); for (int i = 0; i != values.Length; i++) { diff --git a/crypto/test/src/asn1/test/MiscTest.cs b/crypto/test/src/asn1/test/MiscTest.cs index 5c48b6f07..2d005a187 100644 --- a/crypto/test/src/asn1/test/MiscTest.cs +++ b/crypto/test/src/asn1/test/MiscTest.cs @@ -93,7 +93,7 @@ namespace Org.BouncyCastle.Asn1.Tests byte[] data = Base64.Decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvMAoECAECAwQFBgcIFgtodHRwOi8vdGVzdA=="); MemoryStream bOut = new MemoryStream(); - Asn1OutputStream aOut = new Asn1OutputStream(bOut); + Asn1OutputStream aOut = Asn1OutputStream.Create(bOut); for (int i = 0; i != values.Length; i++) { diff --git a/crypto/test/src/asn1/test/X509NameTest.cs b/crypto/test/src/asn1/test/X509NameTest.cs index 9a564f72f..43214c0e4 100644 --- a/crypto/test/src/asn1/test/X509NameTest.cs +++ b/crypto/test/src/asn1/test/X509NameTest.cs @@ -597,12 +597,7 @@ namespace Org.BouncyCastle.Asn1.Tests n = new X509Name("C=AU, O=The Legion of the Bouncy Castle, L=Melbourne + OU=Ascot Vale"); - MemoryStream bOut = new MemoryStream(); - Asn1OutputStream aOut = new Asn1OutputStream(bOut); - - aOut.WriteObject(n); - - byte[] enc2 = bOut.ToArray(); + byte[] enc2 = n.GetEncoded(); if (!Arrays.AreEqual(enc, enc2)) { -- cgit 1.4.1