diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-20 19:01:12 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-20 19:01:12 +0700 |
commit | e5d77a0741bcc55088054b2ad4a91ab0508ac092 (patch) | |
tree | 816fc0d1139945ee9bfd22ca40f1e570e816a02f /crypto/src/asn1/cms/CmsAlgorithmProtection.cs | |
parent | Refactoring in Asn1.Crmf (diff) | |
download | BouncyCastle.NET-ed25519-e5d77a0741bcc55088054b2ad4a91ab0508ac092.tar.xz |
Refactoring in Asn1.Cms
Diffstat (limited to 'crypto/src/asn1/cms/CmsAlgorithmProtection.cs')
-rw-r--r-- | crypto/src/asn1/cms/CmsAlgorithmProtection.cs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/crypto/src/asn1/cms/CmsAlgorithmProtection.cs b/crypto/src/asn1/cms/CmsAlgorithmProtection.cs index 9d21e53ff..cb7a23f84 100644 --- a/crypto/src/asn1/cms/CmsAlgorithmProtection.cs +++ b/crypto/src/asn1/cms/CmsAlgorithmProtection.cs @@ -23,6 +23,20 @@ namespace Org.BouncyCastle.Asn1.Cms public class CmsAlgorithmProtection : Asn1Encodable { + public static CmsAlgorithmProtection GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is CmsAlgorithmProtection cmsAlgorithmProtection) + return cmsAlgorithmProtection; + return new CmsAlgorithmProtection(Asn1Sequence.GetInstance(obj)); + } + + public static CmsAlgorithmProtection GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { + return new CmsAlgorithmProtection(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); + } + public static readonly int Signature = 1; public static readonly int Mac = 2; @@ -78,15 +92,6 @@ namespace Org.BouncyCastle.Asn1.Cms } } - public static CmsAlgorithmProtection GetInstance(object obj) - { - if (obj == null) - return null; - if (obj is CmsAlgorithmProtection cmsAlgorithmProtection) - return cmsAlgorithmProtection; - return new CmsAlgorithmProtection(Asn1Sequence.GetInstance(obj)); - } - public AlgorithmIdentifier DigestAlgorithm => digestAlgorithm; public AlgorithmIdentifier MacAlgorithm => macAlgorithm; |