@@ -21,6 +21,7 @@ public class X509CertStoreSelector
21
21
private X509Certificate certificate ;
22
22
private DateTimeObject certificateValid ;
23
23
private ISet extendedKeyUsage ;
24
+ private bool ignoreX509NameOrdering ;
24
25
private X509Name issuer ;
25
26
private bool [ ] keyUsage ;
26
27
private ISet policy ;
@@ -43,6 +44,7 @@ public X509CertStoreSelector(
43
44
this . certificate = o . Certificate ;
44
45
this . certificateValid = o . CertificateValid ;
45
46
this . extendedKeyUsage = o . ExtendedKeyUsage ;
47
+ this . ignoreX509NameOrdering = o . IgnoreX509NameOrdering ;
46
48
this . issuer = o . Issuer ;
47
49
this . keyUsage = o . KeyUsage ;
48
50
this . policy = o . Policy ;
@@ -95,6 +97,12 @@ public ISet ExtendedKeyUsage
95
97
set { extendedKeyUsage = CopySet ( value ) ; }
96
98
}
97
99
100
+ public bool IgnoreX509NameOrdering
101
+ {
102
+ get { return ignoreX509NameOrdering ; }
103
+ set { this . ignoreX509NameOrdering = value ; }
104
+ }
105
+
98
106
public X509Name Issuer
99
107
{
100
108
get { return issuer ; }
@@ -140,7 +148,8 @@ public X509Name Subject
140
148
set { subject = value ; }
141
149
}
142
150
143
- public string SubjectAsString
151
+ [ Obsolete ( "Avoid working with X509Name objects in string form" ) ]
152
+ public string SubjectAsString
144
153
{
145
154
get { return subject != null ? subject . ToString ( ) : null ; }
146
155
}
@@ -212,7 +221,7 @@ public virtual bool Match(
212
221
}
213
222
}
214
223
215
- if ( issuer != null && ! issuer . Equivalent ( c . IssuerDN , true ) )
224
+ if ( issuer != null && ! issuer . Equivalent ( c . IssuerDN , ! ignoreX509NameOrdering ) )
216
225
return false ;
217
226
218
227
if ( keyUsage != null )
@@ -277,7 +286,7 @@ public virtual bool Match(
277
286
if ( serialNumber != null && ! serialNumber . Equals ( c . SerialNumber ) )
278
287
return false ;
279
288
280
- if ( subject != null && ! subject . Equivalent ( c . SubjectDN , true ) )
289
+ if ( subject != null && ! subject . Equivalent ( c . SubjectDN , ! ignoreX509NameOrdering ) )
281
290
return false ;
282
291
283
292
if ( ! MatchExtension ( subjectKeyIdentifier , c , X509Extensions . SubjectKeyIdentifier ) )
0 commit comments