diff options
Diffstat (limited to 'crypto/src/x509/store/X509CertStoreSelector.cs')
-rw-r--r-- | crypto/src/x509/store/X509CertStoreSelector.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/src/x509/store/X509CertStoreSelector.cs b/crypto/src/x509/store/X509CertStoreSelector.cs index ca15b9efa..c60c8b24b 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.CertificateStructure.SubjectPublicKeyInfo; + + if (subjectPublicKey != null && !subjectPublicKey.Equals(subjectPublicKeyInfo)) return false; if (subjectPublicKeyAlgID != null - && !subjectPublicKeyAlgID.Equals(GetSubjectPublicKey(c).Algorithm)) + && !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) |