Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.6 KiB

  1. ///++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. /// <summary>
  3. ///
  4. /// Filename: Certificate.cs
  5. ///
  6. /// Remark : This class does not inherit from System.Security.Cryptography.
  7. /// X509Certificates.X509Certificate class.
  8. ///
  9. /// History : DSIE 7/16/2002
  10. ///
  11. /// </summary>
  12. /// ---------------------------------------------------------------------------
  13. using System;
  14. using System.Text;
  15. namespace System.Security.Cryptographic.PKI
  16. {
  17. ///[DllImport("Crypt32.dll")]
  18. ///private static extern
  19. ///+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  20. /// <summary>
  21. ///
  22. /// Certificate class to manipulate X509 digital certificate.
  23. ///
  24. /// </summary>
  25. ///
  26. /// ------------------------------------------------------------------------
  27. public class Certificate
  28. {
  29. ///++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  30. ///
  31. /// <summary>
  32. ///
  33. /// Function: Certificate.Create.
  34. ///
  35. /// Synopsis: Static method to create a Certificate instance from
  36. /// certificate stored in file (CER, SST, P7S, P7B, etc.).
  37. ///
  38. /// Remark : If the file contains more than one certificate, such as
  39. /// SST, the very first one encountered will be used.
  40. ///
  41. /// Notes : Should we have a constructor that takes a filename instead
  42. /// of this static method?
  43. ///
  44. /// </summary>
  45. /// <param name="filename"></param>
  46. ///
  47. /// <returns>Certificate</returns>
  48. ///
  49. ///----------------------------------------------------------------------
  50. public static Certificate Create (string filename)
  51. {
  52. Encoding encodingUTF8 = System.Text.Encoding.UTF8;
  53. byte[] certBlob = encodingUTF8.GetBytes("CertBlob");
  54. return new Certificate(certBlob);
  55. }
  56. ///++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  57. ///
  58. /// <summary>
  59. ///
  60. /// Constructor using a byte array containing an ASN encoded X509
  61. /// certificate.
  62. ///
  63. /// </summary>
  64. ///
  65. /// ---------------------------------------------------------------------
  66. public Certificate(byte[] encodedCertificate)
  67. {
  68. //
  69. // TODO: Add constructor logic here
  70. //
  71. }
  72. public int Version
  73. {
  74. get
  75. {
  76. Console.WriteLine("?");
  77. return 3;
  78. }
  79. }
  80. }
  81. }