mscorlib(4.0.0.0) API with additions
X509ChainPolicy.cs
2 
4 {
6  public sealed class X509ChainPolicy
7  {
8  private OidCollection m_applicationPolicy;
9 
10  private OidCollection m_certificatePolicy;
11 
12  private X509RevocationMode m_revocationMode;
13 
14  private X509RevocationFlag m_revocationFlag;
15 
16  private DateTime m_verificationTime;
17 
18  private TimeSpan m_timeout;
19 
20  private X509Certificate2Collection m_extraStore;
21 
22  private X509VerificationFlags m_verificationFlags;
23 
26  public OidCollection ApplicationPolicy => m_applicationPolicy;
27 
30  public OidCollection CertificatePolicy => m_certificatePolicy;
31 
36  {
37  get
38  {
39  return m_revocationMode;
40  }
41  set
42  {
43  if (value < X509RevocationMode.NoCheck || value > X509RevocationMode.Offline)
44  {
45  throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Arg_EnumIllegalVal"), new object[1]
46  {
47  "value"
48  }));
49  }
50  m_revocationMode = value;
51  }
52  }
53 
58  {
59  get
60  {
61  return m_revocationFlag;
62  }
63  set
64  {
65  if (value < X509RevocationFlag.EndCertificateOnly || value > X509RevocationFlag.ExcludeRoot)
66  {
67  throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Arg_EnumIllegalVal"), new object[1]
68  {
69  "value"
70  }));
71  }
72  m_revocationFlag = value;
73  }
74  }
75 
80  {
81  get
82  {
83  return m_verificationFlags;
84  }
85  set
86  {
87  if (value < X509VerificationFlags.NoFlag || value > X509VerificationFlags.AllFlags)
88  {
89  throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.GetString("Arg_EnumIllegalVal"), new object[1]
90  {
91  "value"
92  }));
93  }
94  m_verificationFlags = value;
95  }
96  }
97 
101  {
102  get
103  {
104  return m_verificationTime;
105  }
106  set
107  {
108  m_verificationTime = value;
109  }
110  }
111 
115  {
116  get
117  {
118  return m_timeout;
119  }
120  set
121  {
122  m_timeout = value;
123  }
124  }
125 
128  public X509Certificate2Collection ExtraStore => m_extraStore;
129 
132  {
133  Reset();
134  }
135 
137  public void Reset()
138  {
139  m_applicationPolicy = new OidCollection();
140  m_certificatePolicy = new OidCollection();
141  m_revocationMode = X509RevocationMode.Online;
142  m_revocationFlag = X509RevocationFlag.ExcludeRoot;
143  m_verificationFlags = X509VerificationFlags.NoFlag;
144  m_verificationTime = DateTime.Now;
145  m_timeout = new TimeSpan(0, 0, 0);
146  m_extraStore = new X509Certificate2Collection();
147  }
148  }
149 }
Represents a collection of T:System.Security.Cryptography.Oid objects. This class cannot be inherited...
Definition: OidCollection.cs:7
X509Certificate2Collection ExtraStore
Represents an additional collection of certificates that can be searched by the chaining engine when ...
void Reset()
Resets the T:System.Security.Cryptography.X509Certificates.X509ChainPolicy members to their default v...
Definition: __Canon.cs:3
X509RevocationFlag RevocationFlag
Gets or sets values for X509 revocation flags.
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
Definition: DateTime.cs:13
X509RevocationMode
Specifies the mode used to check for X509 certificate revocation.
DateTime VerificationTime
The time that the certificate was verified expressed in local time.
X509VerificationFlags
Specifies conditions under which verification of certificates in the X509 chain should be conducted.
OidCollection CertificatePolicy
Gets a collection of object identifiers (OIDs) specifying which certificate policies the certificate ...
X509VerificationFlags VerificationFlags
Gets verification flags for the certificate.
Represents the chain policy to be applied when building an X509 certificate chain....
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
Definition: CultureInfo.cs:120
The exception that is thrown when one of the arguments provided to a method is not valid.
Represents a time interval.To browse the .NET Framework source code for this type,...
Definition: TimeSpan.cs:12
static DateTime Now
Gets a T:System.DateTime object that is set to the current date and time on this computer,...
Definition: DateTime.cs:264
TimeSpan UrlRetrievalTimeout
Gets the time span that elapsed during online revocation verification or downloading the certificate ...
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
X509ChainPolicy()
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
X509RevocationMode RevocationMode
Gets or sets values for X509 certificate revocation mode.
Represents a collection of T:System.Security.Cryptography.X509Certificates.X509Certificate2 objects....
X509RevocationFlag
Specifies which X509 certificates in the chain should be checked for revocation.
OidCollection ApplicationPolicy
Gets a collection of object identifiers (OIDs) specifying which application policies or enhanced key ...