diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-11 23:36:32 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-11 23:36:32 +0700 |
commit | 8ed01d5f6322defa0b3dbb1e149b05736f54f832 (patch) | |
tree | fde48f03f14134ecd9b9ece814309bda07e85371 /crypto/src/asn1/tsp/TimeStampReq.cs | |
parent | Obsolete unused segmentLimit (diff) | |
download | BouncyCastle.NET-ed25519-8ed01d5f6322defa0b3dbb1e149b05736f54f832.tar.xz |
Refactoring in Asn1 classes
Diffstat (limited to 'crypto/src/asn1/tsp/TimeStampReq.cs')
-rw-r--r-- | crypto/src/asn1/tsp/TimeStampReq.cs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crypto/src/asn1/tsp/TimeStampReq.cs b/crypto/src/asn1/tsp/TimeStampReq.cs index 7173172c4..027c0a45b 100644 --- a/crypto/src/asn1/tsp/TimeStampReq.cs +++ b/crypto/src/asn1/tsp/TimeStampReq.cs @@ -24,8 +24,7 @@ namespace Org.BouncyCastle.Asn1.Tsp return new TimeStampReq(Asn1Sequence.GetInstance(obj)); } - private TimeStampReq( - Asn1Sequence seq) + private TimeStampReq(Asn1Sequence seq) { int nbObjects = seq.Count; int seqStart = 0; @@ -39,24 +38,23 @@ namespace Org.BouncyCastle.Asn1.Tsp for (int opt = seqStart; opt < nbObjects; opt++) { // tsaPolicy - if (seq[opt] is DerObjectIdentifier) + if (seq[opt] is DerObjectIdentifier oid) { - tsaPolicy = DerObjectIdentifier.GetInstance(seq[opt]); + tsaPolicy = oid; } // nonce - else if (seq[opt] is DerInteger) + else if (seq[opt] is DerInteger derInteger) { - nonce = DerInteger.GetInstance(seq[opt]); + nonce = derInteger; } // certReq - else if (seq[opt] is DerBoolean) + else if (seq[opt] is DerBoolean derBoolean) { - certReq = DerBoolean.GetInstance(seq[opt]); + certReq = derBoolean; } // extensions - else if (seq[opt] is Asn1TaggedObject) + else if (seq[opt] is Asn1TaggedObject tagged) { - Asn1TaggedObject tagged = (Asn1TaggedObject) seq[opt]; if (tagged.TagNo == 0) { extensions = X509Extensions.GetInstance(tagged, false); |