summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-03-20 12:14:35 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-03-20 12:14:35 +0700
commit47336876cd9380b7cba5c7808c0918793cff1243 (patch)
tree189f934ab7ec31043c870b9a845d475969a3041d
parentFix rethrow syntax (diff)
downloadBouncyCastle.NET-ed25519-47336876cd9380b7cba5c7808c0918793cff1243.tar.xz
Register some SM2 sig algs.
-rw-r--r--crypto/src/crypto/operators/Asn1Signature.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/src/crypto/operators/Asn1Signature.cs b/crypto/src/crypto/operators/Asn1Signature.cs
index acbeb12e8..5f493f0c7 100644
--- a/crypto/src/crypto/operators/Asn1Signature.cs
+++ b/crypto/src/crypto/operators/Asn1Signature.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.CryptoPro;
 using Org.BouncyCastle.Asn1.EdEC;
+using Org.BouncyCastle.Asn1.GM;
 using Org.BouncyCastle.Asn1.Nist;
 using Org.BouncyCastle.Asn1.Oiw;
 using Org.BouncyCastle.Asn1.Pkcs;
@@ -102,6 +103,9 @@ namespace Org.BouncyCastle.Crypto.Operators
             m_algorithms.Add("Ed448", EdECObjectIdentifiers.id_Ed448);
             // TODO Ed25519ctx, Ed25519ph, Ed448ph
 
+            m_algorithms.Add("SHA256WITHSM2", GMObjectIdentifiers.sm2sign_with_sha256);
+            m_algorithms.Add("SM3WITHSM2", GMObjectIdentifiers.sm2sign_with_sm3);
+
             //
             // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field.
             // The parameters field SHALL be NULL for RSA based signature algorithms.