From 3eb93b423abeefbdc03f0ecc38751d76428ba23e Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 4 Jun 2019 16:55:26 +0700 Subject: Refactoring --- crypto/src/asn1/x509/AuthorityKeyIdentifier.cs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'crypto/src/asn1/x509/AuthorityKeyIdentifier.cs') diff --git a/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs b/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs index d5a9048cc..aca1dc330 100644 --- a/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs +++ b/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs @@ -184,23 +184,10 @@ namespace Org.BouncyCastle.Asn1.X509 public override Asn1Object ToAsn1Object() { Asn1EncodableVector v = new Asn1EncodableVector(); - - if (keyidentifier != null) - { - v.Add(new DerTaggedObject(false, 0, keyidentifier)); - } - - if (certissuer != null) - { - v.Add(new DerTaggedObject(false, 1, certissuer)); - } - - if (certserno != null) - { - v.Add(new DerTaggedObject(false, 2, certserno)); - } - - return new DerSequence(v); + v.AddOptionalTagged(false, 0, keyidentifier); + v.AddOptionalTagged(false, 1, certissuer); + v.AddOptionalTagged(false, 2, certserno); + return new DerSequence(v); } public override string ToString() -- cgit 1.4.1