summary refs log tree commit diff
path: root/crypto/src/x509/store/X509CertStoreSelector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/x509/store/X509CertStoreSelector.cs')
-rw-r--r--crypto/src/x509/store/X509CertStoreSelector.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/src/x509/store/X509CertStoreSelector.cs b/crypto/src/x509/store/X509CertStoreSelector.cs
index 54ae923a9..a153868d4 100644
--- a/crypto/src/x509/store/X509CertStoreSelector.cs
+++ b/crypto/src/x509/store/X509CertStoreSelector.cs
@@ -276,11 +276,13 @@ namespace Org.BouncyCastle.X509.Store
 			if (!MatchExtension(subjectKeyIdentifier, c, X509Extensions.SubjectKeyIdentifier))
 				return false;
 
-			if (subjectPublicKey != null && !subjectPublicKey.Equals(GetSubjectPublicKey(c)))
+			SubjectPublicKeyInfo subjectPublicKeyInfo = c.SubjectPublicKeyInfo;
+
+            if (subjectPublicKey != null && !subjectPublicKey.Equals(subjectPublicKeyInfo))
 				return false;
 
 			if (subjectPublicKeyAlgID != null
-				&& !subjectPublicKeyAlgID.Equals(GetSubjectPublicKey(c).AlgorithmID))
+				&& !subjectPublicKeyAlgID.Equals(subjectPublicKeyInfo.Algorithm))
 				return false;
 
 			return true;
@@ -306,11 +308,6 @@ namespace Org.BouncyCastle.X509.Store
 			return s == null ? null : new HashSet<T>(s);
 		}
 
-		private static SubjectPublicKeyInfo GetSubjectPublicKey(X509Certificate c)
-		{
-			return c.CertificateStructure.SubjectPublicKeyInfo;
-		}
-
 		private static bool MatchExtension(byte[] b, X509Certificate c, DerObjectIdentifier	oid)
 		{
 			if (b == null)