summary refs log tree commit diff
path: root/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-04-17 13:32:41 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-04-17 13:32:41 +0700
commitc1fe1982e3a7d0748e98ec4e4c54d098e74fc658 (patch)
tree00cc1ede3d38d257525270495a054d26cabe723d /crypto/src/pkix/PkixCertPathValidatorUtilities.cs
parentPKIX: explicit validation of version number and extension repeats (diff)
downloadBouncyCastle.NET-ed25519-c1fe1982e3a7d0748e98ec4e4c54d098e74fc658.tar.xz
PKIX: Allow a V0 TA to appear at end of the cert path.
Diffstat (limited to 'crypto/src/pkix/PkixCertPathValidatorUtilities.cs')
-rw-r--r--crypto/src/pkix/PkixCertPathValidatorUtilities.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
index a2704a746..2ccaa32ce 100644
--- a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
+++ b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
@@ -143,6 +143,20 @@ namespace Org.BouncyCastle.Pkix
 			return trust;
 		}
 
+        internal static bool IsIssuerTrustAnchor(
+            X509Certificate cert,
+            ISet trustAnchors)
+        {
+            try
+            {
+                return FindTrustAnchor(cert, trustAnchors) != null;
+            }
+            catch (Exception e)
+            {
+                return false;
+            }
+        }
+
 		internal static void AddAdditionalStoresFromAltNames(
 			X509Certificate	cert,
 			PkixParameters	pkixParams)