summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-02-20 01:37:07 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-02-20 01:37:07 +0700
commit765426a8dc1fe20295f91d55e7bbf539e6b831fc (patch)
tree8e62ef9b9f45be2030ff490bd09834f2fb4df7a5 /crypto/src/asn1
parentMark methods as "Var" for clarity (diff)
downloadBouncyCastle.NET-ed25519-765426a8dc1fe20295f91d55e7bbf539e6b831fc.tar.xz
Misc. updates from bc-java
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/nist/NISTObjectIdentifiers.cs4
-rw-r--r--crypto/src/asn1/pkcs/CertBag.cs16
2 files changed, 16 insertions, 4 deletions
diff --git a/crypto/src/asn1/nist/NISTObjectIdentifiers.cs b/crypto/src/asn1/nist/NISTObjectIdentifiers.cs
index 840718ccd..417fa8df9 100644
--- a/crypto/src/asn1/nist/NISTObjectIdentifiers.cs
+++ b/crypto/src/asn1/nist/NISTObjectIdentifiers.cs
@@ -35,6 +35,10 @@ namespace Org.BouncyCastle.Asn1.Nist
         public static readonly DerObjectIdentifier IdHMacWithSha3_256 = HashAlgs.Branch("14");
         public static readonly DerObjectIdentifier IdHMacWithSha3_384 = HashAlgs.Branch("15");
         public static readonly DerObjectIdentifier IdHMacWithSha3_512 = HashAlgs.Branch("16");
+        public static readonly DerObjectIdentifier IdShake128Len = HashAlgs.Branch("17");
+        public static readonly DerObjectIdentifier IdShake256Len = HashAlgs.Branch("18");
+        public static readonly DerObjectIdentifier IdKmacWithShake128 = HashAlgs.Branch("19");
+        public static readonly DerObjectIdentifier IdKmacWithShake256 = HashAlgs.Branch("20");
 
         public static readonly DerObjectIdentifier Aes = new DerObjectIdentifier(NistAlgorithm + ".1");
 
diff --git a/crypto/src/asn1/pkcs/CertBag.cs b/crypto/src/asn1/pkcs/CertBag.cs
index e561fb890..61165c087 100644
--- a/crypto/src/asn1/pkcs/CertBag.cs
+++ b/crypto/src/asn1/pkcs/CertBag.cs
@@ -5,17 +5,25 @@ namespace Org.BouncyCastle.Asn1.Pkcs
     public class CertBag
         : Asn1Encodable
     {
-//		private readonly Asn1Sequence seq;
+        public static CertBag GetInstance(object obj)
+        {
+            if (obj is CertBag)
+                return (CertBag)obj;
+            if (obj == null)
+                return null;
+            return new CertBag(Asn1Sequence.GetInstance(obj));
+        }
+
         private readonly DerObjectIdentifier certID;
         private readonly Asn1Object certValue;
 
+        [Obsolete("Use 'GetInstance' instead")]
 		public CertBag(
             Asn1Sequence seq)
         {
 			if (seq.Count != 2)
 				throw new ArgumentException("Wrong number of elements in sequence", "seq");
 
-//			this.seq = seq;
             this.certID = DerObjectIdentifier.GetInstance(seq[0]);
             this.certValue = Asn1TaggedObject.GetInstance(seq[1]).GetObject();
         }
@@ -28,12 +36,12 @@ namespace Org.BouncyCastle.Asn1.Pkcs
             this.certValue = certValue;
         }
 
-		public DerObjectIdentifier CertID
+		public virtual DerObjectIdentifier CertID
 		{
 			get { return certID; }
 		}
 
-		public Asn1Object CertValue
+		public virtual Asn1Object CertValue
 		{
 			get { return certValue; }
 		}