summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-07 12:36:21 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-07 12:36:21 +0700
commita23c80e6762b7016b4c29af81709388610b04fcc (patch)
tree0e7ad921fbff82349686025aec0a8dc8c6e7c655 /crypto
parentCHOICE cannot be implicitly tagged (diff)
downloadBouncyCastle.NET-ed25519-a23c80e6762b7016b4c29af81709388610b04fcc.tar.xz
Add direct PKMacValue constructor
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/asn1/crmf/PopoPrivKey.cs6
-rw-r--r--crypto/src/crmf/CertificateRequestMessageBuilder.cs4
2 files changed, 7 insertions, 3 deletions
diff --git a/crypto/src/asn1/crmf/PopoPrivKey.cs b/crypto/src/asn1/crmf/PopoPrivKey.cs
index 95a4484de..e7cef784c 100644
--- a/crypto/src/asn1/crmf/PopoPrivKey.cs
+++ b/crypto/src/asn1/crmf/PopoPrivKey.cs
@@ -47,6 +47,12 @@ namespace Org.BouncyCastle.Asn1.Crmf
             return new PopoPrivKey(Asn1TaggedObject.GetInstance(tagged, true));
         }
 
+        public PopoPrivKey(PKMacValue pkMacValue)
+        {
+            this.tagNo = agreeMAC;
+            this.obj = pkMacValue;
+        }
+
         public PopoPrivKey(SubsequentMessage msg)
         {
             this.tagNo = subsequentMessage;
diff --git a/crypto/src/crmf/CertificateRequestMessageBuilder.cs b/crypto/src/crmf/CertificateRequestMessageBuilder.cs
index 363bfd136..d09084fb3 100644
--- a/crypto/src/crmf/CertificateRequestMessageBuilder.cs
+++ b/crypto/src/crmf/CertificateRequestMessageBuilder.cs
@@ -251,9 +251,7 @@ namespace Org.BouncyCastle.Crmf
             }
             else if (_agreeMac != null)
             {
-                v.Add(new ProofOfPossession(ProofOfPossession.TYPE_KEY_AGREEMENT,
-                        PopoPrivKey.GetInstance(new DerTaggedObject(false, PopoPrivKey.agreeMAC, _agreeMac), true)));
-
+                v.Add(new ProofOfPossession(ProofOfPossession.TYPE_KEY_AGREEMENT, new PopoPrivKey(_agreeMac)));
             }
             else if (_popRaVerified != null)
             {