summary refs log tree commit diff
path: root/crypto/src/pkix
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-28 18:57:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-28 18:57:30 +0700
commit558aef70537b3882e5616e9d0e7b40d971e2dd42 (patch)
tree1ac43c975f414e69a268dca315a10a87fa406ea8 /crypto/src/pkix
parentAdd Xoodyak to the master branch (diff)
downloadBouncyCastle.NET-ed25519-558aef70537b3882e5616e9d0e7b40d971e2dd42.tar.xz
Misc. cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/pkix')
-rw-r--r--crypto/src/pkix/CertStatus.cs2
-rw-r--r--crypto/src/pkix/PkixCertPathBuilderResult.cs24
-rw-r--r--crypto/src/pkix/PkixCertPathValidatorResult.cs17
-rw-r--r--crypto/src/pkix/PkixNameConstraintValidator.cs5
-rw-r--r--crypto/src/pkix/PkixParameters.cs9
5 files changed, 20 insertions, 37 deletions
diff --git a/crypto/src/pkix/CertStatus.cs b/crypto/src/pkix/CertStatus.cs
index aff1b1857..4fe98998c 100644
--- a/crypto/src/pkix/CertStatus.cs
+++ b/crypto/src/pkix/CertStatus.cs
@@ -15,7 +15,7 @@ namespace Org.BouncyCastle.Pkix
         /// <summary>
         /// Returns the revocationDate.
         /// </summary>
-         public DateTime? RevocationDate
+        public DateTime? RevocationDate
         {
             get { return revocationDate; }
             set { this.revocationDate = value; }
diff --git a/crypto/src/pkix/PkixCertPathBuilderResult.cs b/crypto/src/pkix/PkixCertPathBuilderResult.cs
index a9dfc6722..6494f9b7b 100644
--- a/crypto/src/pkix/PkixCertPathBuilderResult.cs
+++ b/crypto/src/pkix/PkixCertPathBuilderResult.cs
@@ -2,32 +2,22 @@ using System;
 using System.Text;
 
 using Org.BouncyCastle.Crypto;
-using Org.BouncyCastle.Pkix;
 
 namespace Org.BouncyCastle.Pkix
 {
-	/// <summary>
-	/// Summary description for PkixCertPathBuilderResult.
-	/// </summary>
 	public class PkixCertPathBuilderResult
 		: PkixCertPathValidatorResult//, ICertPathBuilderResult
 	{
 		private PkixCertPath certPath;
-		
-		public PkixCertPathBuilderResult(
-			PkixCertPath			certPath,
-			TrustAnchor				trustAnchor,
-			PkixPolicyNode			policyTree,
-			AsymmetricKeyParameter	subjectPublicKey)
-			: base(trustAnchor, policyTree, subjectPublicKey)
-		{			
-			if (certPath == null)
-				throw new ArgumentNullException("certPath");
 
-			this.certPath = certPath;
-		}
+        public PkixCertPathBuilderResult(PkixCertPath certPath, TrustAnchor trustAnchor, PkixPolicyNode policyTree,
+            AsymmetricKeyParameter subjectPublicKey)
+            : base(trustAnchor, policyTree, subjectPublicKey)
+		{			
+			this.certPath = certPath ?? throw new ArgumentNullException(nameof(certPath));
+        }
 
-		public PkixCertPath CertPath
+        public PkixCertPath CertPath
 		{
             get { return certPath; }
 		}
diff --git a/crypto/src/pkix/PkixCertPathValidatorResult.cs b/crypto/src/pkix/PkixCertPathValidatorResult.cs
index 07cb350c1..b89ec9d53 100644
--- a/crypto/src/pkix/PkixCertPathValidatorResult.cs
+++ b/crypto/src/pkix/PkixCertPathValidatorResult.cs
@@ -2,13 +2,9 @@ using System;
 using System.Text;
 
 using Org.BouncyCastle.Crypto;
-using Org.BouncyCastle.Security;
 
 namespace Org.BouncyCastle.Pkix
 {
-	/// <summary>
-	/// Summary description for PkixCertPathValidatorResult.
-	/// </summary>
 	public class PkixCertPathValidatorResult
 		//: ICertPathValidatorResult
 	{
@@ -34,15 +30,10 @@ namespace Org.BouncyCastle.Pkix
 		public PkixCertPathValidatorResult(TrustAnchor trustAnchor, PkixPolicyNode policyTree,
 			AsymmetricKeyParameter subjectPublicKey)
 		{
-            if (trustAnchor == null)
-                throw new ArgumentNullException(nameof(trustAnchor));
-            if (subjectPublicKey == null)
-				throw new ArgumentNullException(nameof(subjectPublicKey));
-
-			this.trustAnchor = trustAnchor;
-			this.policyTree = policyTree;
-			this.subjectPublicKey = subjectPublicKey;
-		}
+			this.trustAnchor = trustAnchor ?? throw new ArgumentNullException(nameof(trustAnchor));
+            this.policyTree = policyTree;
+			this.subjectPublicKey = subjectPublicKey ?? throw new ArgumentNullException(nameof(subjectPublicKey));
+        }
 
 		public object Clone()
 		{
diff --git a/crypto/src/pkix/PkixNameConstraintValidator.cs b/crypto/src/pkix/PkixNameConstraintValidator.cs
index 840755060..879054c7f 100644
--- a/crypto/src/pkix/PkixNameConstraintValidator.cs
+++ b/crypto/src/pkix/PkixNameConstraintValidator.cs
@@ -1806,7 +1806,8 @@ namespace Org.BouncyCastle.Pkix
 
         public override string ToString()
         {
-            StringBuilder sb = new StringBuilder("permitted:\n");
+            StringBuilder sb = new StringBuilder("permitted:");
+            sb.AppendLine();
             if (permittedSubtreesDN != null)
             {
                 Append(sb, "DN", permittedSubtreesDN);
@@ -1831,7 +1832,7 @@ namespace Org.BouncyCastle.Pkix
             {
                 Append(sb, "OtherName", StringifyOtherNameCollection(permittedSubtreesOtherName));
             }
-            sb.Append("excluded:\n");
+            sb.AppendLine("excluded:");
             if (excludedSubtreesDN.Count > 0)
             {
                 Append(sb, "DN", excludedSubtreesDN);
diff --git a/crypto/src/pkix/PkixParameters.cs b/crypto/src/pkix/PkixParameters.cs
index 0eb43c000..192a78780 100644
--- a/crypto/src/pkix/PkixParameters.cs
+++ b/crypto/src/pkix/PkixParameters.cs
@@ -249,9 +249,11 @@ namespace Org.BouncyCastle.Pkix
 		* @see X509CertStoreSelector
 		* @see X509AttributeCertStoreSelector
 		*/
-		public virtual void SetTargetConstraintsAttrCert(ISelector<X509V2AttributeCertificate> targetConstraintsAttrCert)
+		public virtual void SetTargetConstraintsAttrCert(
+			ISelector<X509V2AttributeCertificate> targetConstraintsAttrCert)
 		{
-			this.m_targetConstraintsAttrCert = (ISelector<X509V2AttributeCertificate>)targetConstraintsAttrCert?.Clone();
+			this.m_targetConstraintsAttrCert = (ISelector<X509V2AttributeCertificate>)
+				targetConstraintsAttrCert?.Clone();
 		}
 
 		/**
@@ -625,8 +627,7 @@ namespace Org.BouncyCastle.Pkix
 		*
 		* @param enabled <code>true</code> if additional stores are used.
 		*/
-		public virtual void SetAdditionalLocationsEnabled(
-			bool enabled)
+		public virtual void SetAdditionalLocationsEnabled(bool enabled)
 		{
 			additionalLocationsEnabled = enabled;
 		}