X509ChainPolicy.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // X509ChainPolicy.cs - System.Security.Cryptography.X509Certificates.X509ChainPolicy
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. #if NET_1_2
  10. using System;
  11. using System.Security.Cryptography;
  12. namespace System.Security.Cryptography.X509Certificates {
  13. // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
  14. public sealed class X509ChainPolicy {
  15. private OidCollection _apps;
  16. private OidCollection _cert;
  17. private X509CertificateExCollection _store;
  18. private X509RevocationFlag _rflag;
  19. private X509RevocationMode _mode;
  20. private TimeSpan _timeout;
  21. private X509VerificationFlags _vflags;
  22. private DateTime _vtime;
  23. // constructors
  24. // only accessible from X509Chain
  25. internal X509ChainPolicy ()
  26. {
  27. Reset ();
  28. }
  29. // properties
  30. public OidCollection ApplicationPolicy {
  31. get { return _apps; }
  32. }
  33. public OidCollection CertificatePolicy {
  34. get { return _cert; }
  35. }
  36. public X509CertificateExCollection ExtraStore {
  37. get { return _store; }
  38. }
  39. public X509RevocationFlag RevocationFlag {
  40. get { return _rflag; }
  41. set { _rflag = value; }
  42. }
  43. public X509RevocationMode RevocationMode {
  44. get { return _mode; }
  45. set { _mode = value; }
  46. }
  47. public TimeSpan UrlRetrievalTimeout {
  48. get { return _timeout; }
  49. set { _timeout = value; }
  50. }
  51. public X509VerificationFlags VerificationFlags {
  52. get { return _vflags; }
  53. set { _vflags = value; }
  54. }
  55. public DateTime VerificationTime {
  56. get { return _vtime; }
  57. set { _vtime = value; }
  58. }
  59. // methods
  60. public void Reset ()
  61. {
  62. _apps = new OidCollection ();
  63. _cert = new OidCollection ();
  64. _store = new X509CertificateExCollection ();
  65. _rflag = X509RevocationFlag.ExcludeRoot;
  66. _mode = X509RevocationMode.Online;
  67. _timeout = new TimeSpan (0);
  68. _vflags = X509VerificationFlags.NoFlag;
  69. _vtime = DateTime.Now;
  70. }
  71. }
  72. }
  73. #endif