diff options
Diffstat (limited to 'crypto/src/asn1/cmp')
-rw-r--r-- | crypto/src/asn1/cmp/PKIHeaderBuilder.cs | 11 | ||||
-rw-r--r-- | crypto/src/asn1/cmp/PKIMessage.cs | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/crypto/src/asn1/cmp/PKIHeaderBuilder.cs b/crypto/src/asn1/cmp/PKIHeaderBuilder.cs index 3426c8f0e..29f37f7d9 100644 --- a/crypto/src/asn1/cmp/PKIHeaderBuilder.cs +++ b/crypto/src/asn1/cmp/PKIHeaderBuilder.cs @@ -120,15 +120,10 @@ namespace Org.BouncyCastle.Asn1.Cmp return this; } - private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue generalInfo) - { - return new DerSequence(generalInfo); - } + private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue generalInfo) => new DerSequence(generalInfo); - private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue[] generalInfos) - { - return generalInfos == null ? null : DerSequence.FromElements(generalInfos); - } + private static Asn1Sequence MakeGeneralInfoSeq(InfoTypeAndValue[] generalInfos) => + DerSequence.FromElementsOptional(generalInfos); /** * <pre> diff --git a/crypto/src/asn1/cmp/PKIMessage.cs b/crypto/src/asn1/cmp/PKIMessage.cs index 7008a9e1c..a408fead5 100644 --- a/crypto/src/asn1/cmp/PKIMessage.cs +++ b/crypto/src/asn1/cmp/PKIMessage.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Asn1.Cmp m_header = header ?? throw new ArgumentNullException(nameof(header)); m_body = body ?? throw new ArgumentNullException(nameof(body)); m_protection = protection; - m_extraCerts = extraCerts == null ? null : DerSequence.FromElements(extraCerts); + m_extraCerts = DerSequence.FromElementsOptional(extraCerts); } public PkiMessage(PkiHeader header, PkiBody body, DerBitString protection) |