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/cms/AuthenticatedData.cs | |
parent | Obsolete unused segmentLimit (diff) | |
download | BouncyCastle.NET-ed25519-8ed01d5f6322defa0b3dbb1e149b05736f54f832.tar.xz |
Refactoring in Asn1 classes
Diffstat (limited to 'crypto/src/asn1/cms/AuthenticatedData.cs')
-rw-r--r-- | crypto/src/asn1/cms/AuthenticatedData.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/src/asn1/cms/AuthenticatedData.cs b/crypto/src/asn1/cms/AuthenticatedData.cs index eb9f82031..6ec8061e2 100644 --- a/crypto/src/asn1/cms/AuthenticatedData.cs +++ b/crypto/src/asn1/cms/AuthenticatedData.cs @@ -48,17 +48,16 @@ namespace Org.BouncyCastle.Asn1.Cms this.unauthAttrs = unauthAttrs; } - private AuthenticatedData( - Asn1Sequence seq) + private AuthenticatedData(Asn1Sequence seq) { int index = 0; version = (DerInteger)seq[index++]; Asn1Encodable tmp = seq[index++]; - if (tmp is Asn1TaggedObject) + if (tmp is Asn1TaggedObject taggedObject1) { - originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject)tmp, false); + originatorInfo = OriginatorInfo.GetInstance(taggedObject1, false); tmp = seq[index++]; } @@ -66,18 +65,18 @@ namespace Org.BouncyCastle.Asn1.Cms macAlgorithm = AlgorithmIdentifier.GetInstance(seq[index++]); tmp = seq[index++]; - if (tmp is Asn1TaggedObject) + if (tmp is Asn1TaggedObject taggedObject2) { - digestAlgorithm = AlgorithmIdentifier.GetInstance((Asn1TaggedObject)tmp, false); + digestAlgorithm = AlgorithmIdentifier.GetInstance(taggedObject2, false); tmp = seq[index++]; } encapsulatedContentInfo = ContentInfo.GetInstance(tmp); tmp = seq[index++]; - if (tmp is Asn1TaggedObject) + if (tmp is Asn1TaggedObject taggedObject3) { - authAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false); + authAttrs = Asn1Set.GetInstance(taggedObject3, false); tmp = seq[index++]; } |