summary refs log tree commit diff
path: root/crypto/src/cms/CMSSignedHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cms/CMSSignedHelper.cs')
-rw-r--r--crypto/src/cms/CMSSignedHelper.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/src/cms/CMSSignedHelper.cs b/crypto/src/cms/CMSSignedHelper.cs
index e136397f2..79290846e 100644
--- a/crypto/src/cms/CMSSignedHelper.cs
+++ b/crypto/src/cms/CMSSignedHelper.cs
@@ -261,6 +261,22 @@ namespace Org.BouncyCastle.Cms
                 {
                     encOID = CmsSignedGenerator.EncryptionECGost3410;
                 }
+                else if (ecPrivKey.Parameters is ECGost3410Parameters ecGost3410Parameters)
+                {
+					var digestParamSet = ecGost3410Parameters.DigestParamSet;
+                    if (digestParamSet.Equals(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256))
+					{
+                        encOID = CmsSignedGenerator.EncryptionECGost3410_2012_256;
+                    }
+                    else if (digestParamSet.Equals(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512))
+					{
+                        encOID = CmsSignedGenerator.EncryptionECGost3410_2012_512;
+                    }
+                    else
+					{
+                        throw new ArgumentException("can't determine GOST3410 algorithm");
+                    }
+                }
                 else
 				{
 					// TODO Should we insist on algName being one of "EC" or "ECDSA", as Java does?