diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-04 17:58:40 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2019-08-04 17:58:40 +0700 |
commit | 4af2753c154c2f5cab5a48093a666b275ad81339 (patch) | |
tree | c3e4f221e24f69ae6ed510aa35ef0a5967264229 /crypto/test/src/asn1 | |
parent | Refactoring in PublicKeyFactory (diff) | |
download | BouncyCastle.NET-ed25519-4af2753c154c2f5cab5a48093a666b275ad81339.tar.xz |
Misc. ASN.1 updates
Diffstat (limited to 'crypto/test/src/asn1')
-rw-r--r-- | crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs b/crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs index bd1fb5a9e..f9eef4f47 100644 --- a/crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs +++ b/crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs @@ -20,11 +20,11 @@ namespace Org.BouncyCastle.Asn1.Tests DerGeneralizedTime dateOfBirth = new DerGeneralizedTime("20070315173729Z"); DeclarationOfMajority decl = new DeclarationOfMajority(dateOfBirth); - checkConstruction(decl, DeclarationOfMajority.Choice.DateOfBirth, dateOfBirth, -1); + CheckConstruction(decl, DeclarationOfMajority.Choice.DateOfBirth, dateOfBirth, -1); decl = new DeclarationOfMajority(6); - checkConstruction(decl, DeclarationOfMajority.Choice.NotYoungerThan, null, 6); + CheckConstruction(decl, DeclarationOfMajority.Choice.NotYoungerThan, null, 6); decl = DeclarationOfMajority.GetInstance(null); @@ -45,28 +45,24 @@ namespace Org.BouncyCastle.Asn1.Tests } } - private void checkConstruction( + private void CheckConstruction( DeclarationOfMajority decl, DeclarationOfMajority.Choice type, DerGeneralizedTime dateOfBirth, int notYoungerThan) { - checkValues(decl, type, dateOfBirth, notYoungerThan); + CheckValues(decl, type, dateOfBirth, notYoungerThan); decl = DeclarationOfMajority.GetInstance(decl); - checkValues(decl, type, dateOfBirth, notYoungerThan); + CheckValues(decl, type, dateOfBirth, notYoungerThan); - Asn1InputStream aIn = new Asn1InputStream(decl.ToAsn1Object().GetEncoded()); + decl = DeclarationOfMajority.GetInstance(Asn1Object.FromByteArray(decl.GetEncoded())); - DerTaggedObject info = (DerTaggedObject) aIn.ReadObject(); - - decl = DeclarationOfMajority.GetInstance(info); - - checkValues(decl, type, dateOfBirth, notYoungerThan); + CheckValues(decl, type, dateOfBirth, notYoungerThan); } - private void checkValues( + private void CheckValues( DeclarationOfMajority decl, DeclarationOfMajority.Choice type, DerGeneralizedTime dateOfBirth, |