summary refs log tree commit diff
path: root/crypto/src/asn1/tsp/CryptoInfos.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-07-01 19:23:46 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-07-01 19:23:46 +0700
commit4e97fa1cbee0072938c5ea33ca51f4e3964f2998 (patch)
tree0aad9c9bc277429ee733c8383672cb7c6aed329a /crypto/src/asn1/tsp/CryptoInfos.cs
parentRefactoring in Asn1.Smime (diff)
downloadBouncyCastle.NET-ed25519-4e97fa1cbee0072938c5ea33ca51f4e3964f2998.tar.xz
Refactoring in Asn1.Tsp
Diffstat (limited to 'crypto/src/asn1/tsp/CryptoInfos.cs')
-rw-r--r--crypto/src/asn1/tsp/CryptoInfos.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/src/asn1/tsp/CryptoInfos.cs b/crypto/src/asn1/tsp/CryptoInfos.cs
index b99afad76..44b3cdbc8 100644
--- a/crypto/src/asn1/tsp/CryptoInfos.cs
+++ b/crypto/src/asn1/tsp/CryptoInfos.cs
@@ -19,10 +19,11 @@ namespace Org.BouncyCastle.Asn1.Tsp
             return new CryptoInfos(Asn1Sequence.GetInstance(obj));
         }
 
-        public static CryptoInfos GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
-        {
-            return new CryptoInfos(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
-        }
+        public static CryptoInfos GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) =>
+            new CryptoInfos(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+
+        public static CryptoInfos GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit) =>
+            new CryptoInfos(Asn1Sequence.GetTagged(taggedObject, declaredExplicit));
 
         private readonly Asn1Sequence m_attributes;
 
@@ -33,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Tsp
 
         public CryptoInfos(Asn1.Cms.Attribute[] attrs)
         {
-            m_attributes = new DerSequence(attrs);
+            m_attributes = DerSequence.FromElements(attrs);
         }
 
         public virtual Asn1.Cms.Attribute[] GetAttributes() => m_attributes.MapElements(Asn1.Cms.Attribute.GetInstance);