summary refs log tree commit diff
path: root/crypto/src/x509
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-07-26 17:58:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-07-26 17:58:23 +0700
commit21bfdd9eb9683fcad861a5b528729d6afcbe6863 (patch)
tree5830f6f898b5eb7e3e096f488b192e3204ab1214 /crypto/src/x509
parentUpdate XML doc (diff)
downloadBouncyCastle.NET-ed25519-21bfdd9eb9683fcad861a5b528729d6afcbe6863.tar.xz
CMP updates from bc-java
Diffstat (limited to 'crypto/src/x509')
-rw-r--r--crypto/src/x509/X509Certificate.cs4
-rw-r--r--crypto/src/x509/X509V3CertificateGenerator.cs23
2 files changed, 20 insertions, 7 deletions
diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs
index b1307d90e..944b627b0 100644
--- a/crypto/src/x509/X509Certificate.cs
+++ b/crypto/src/x509/X509Certificate.cs
@@ -312,6 +312,9 @@ namespace Org.BouncyCastle.X509
             return Arrays.Clone(sigAlgParams);
         }
 
+        /// <summary>The signature algorithm.</summary>
+        public virtual AlgorithmIdentifier SignatureAlgorithm => c.SignatureAlgorithm;
+
         /// <summary>
         /// Get the issuers UID.
         /// </summary>
@@ -629,6 +632,7 @@ namespace Org.BouncyCastle.X509
             return buf.ToString();
         }
 
+        // TODO[api] Rename 'key' to 'publicKey'
         public virtual bool IsSignatureValid(AsymmetricKeyParameter key)
         {
             return CheckSignatureValid(new Asn1VerifierFactory(c.SignatureAlgorithm, key));
diff --git a/crypto/src/x509/X509V3CertificateGenerator.cs b/crypto/src/x509/X509V3CertificateGenerator.cs
index 1dd1776be..2df8d5409 100644
--- a/crypto/src/x509/X509V3CertificateGenerator.cs
+++ b/crypto/src/x509/X509V3CertificateGenerator.cs
@@ -156,13 +156,22 @@ namespace Org.BouncyCastle.X509
 			tbsGen.SetIssuerUniqueID(BooleanToBitString(uniqueID));
 		}
 
-		/// <summary>
-		/// Add a given extension field for the standard extensions tag (tag 3).
-		/// </summary>
-		/// <param name="oid">string containing a dotted decimal Object Identifier.</param>
-		/// <param name="critical">Is it critical.</param>
-		/// <param name="extensionValue">The value.</param>
-		public void AddExtension(
+        /// <summary>
+        /// Set the SubjectPublicKeyInfo for the public key that this certificate identifies.
+        /// </summary>
+        /// <param name="subjectPublicKeyInfo"/>
+        public void SetSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo)
+        {
+            tbsGen.SetSubjectPublicKeyInfo(subjectPublicKeyInfo);
+        }
+
+        /// <summary>
+        /// Add a given extension field for the standard extensions tag (tag 3).
+        /// </summary>
+        /// <param name="oid">string containing a dotted decimal Object Identifier.</param>
+        /// <param name="critical">Is it critical.</param>
+        /// <param name="extensionValue">The value.</param>
+        public void AddExtension(
 			string			oid,
 			bool			critical,
 			Asn1Encodable	extensionValue)