diff options
Diffstat (limited to 'crypto/src/asn1/x9')
-rw-r--r-- | crypto/src/asn1/x9/DHDomainParameters.cs | 22 | ||||
-rw-r--r-- | crypto/src/asn1/x9/OtherInfo.cs | 12 |
2 files changed, 9 insertions, 25 deletions
diff --git a/crypto/src/asn1/x9/DHDomainParameters.cs b/crypto/src/asn1/x9/DHDomainParameters.cs index b8c1ac030..a92322717 100644 --- a/crypto/src/asn1/x9/DHDomainParameters.cs +++ b/crypto/src/asn1/x9/DHDomainParameters.cs @@ -98,21 +98,11 @@ namespace Org.BouncyCastle.Asn1.X9 get { return this.validationParms; } } - public override Asn1Object ToAsn1Object() - { - Asn1EncodableVector v = new Asn1EncodableVector(p, g, q); - - if (this.j != null) - { - v.Add(this.j); - } - - if (this.validationParms != null) - { - v.Add(this.validationParms); - } - - return new DerSequence(v); - } + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(p, g, q); + v.AddOptional(j, validationParms); + return new DerSequence(v); + } } } diff --git a/crypto/src/asn1/x9/OtherInfo.cs b/crypto/src/asn1/x9/OtherInfo.cs index 21863bd17..4a52b7206 100644 --- a/crypto/src/asn1/x9/OtherInfo.cs +++ b/crypto/src/asn1/x9/OtherInfo.cs @@ -74,15 +74,9 @@ namespace Org.BouncyCastle.Asn1.X9 public override Asn1Object ToAsn1Object() { Asn1EncodableVector v = new Asn1EncodableVector(keyInfo); - - if (partyAInfo != null) - { - v.Add(new DerTaggedObject(0, partyAInfo)); - } - - v.Add(new DerTaggedObject(2, suppPubInfo)); - - return new DerSequence(v); + v.AddOptionalTagged(true, 0, partyAInfo); + v.Add(new DerTaggedObject(2, suppPubInfo)); + return new DerSequence(v); } } } |