IX509AttributeCertificate.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
  7. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
  8. {
  9. /// <remarks>Interface for an X.509 Attribute Certificate.</remarks>
  10. public interface IX509AttributeCertificate
  11. : IX509Extension
  12. {
  13. /// <summary>The version number for the certificate.</summary>
  14. int Version { get; }
  15. /// <summary>The serial number for the certificate.</summary>
  16. BigInteger SerialNumber { get; }
  17. /// <summary>The UTC DateTime before which the certificate is not valid.</summary>
  18. DateTime NotBefore { get; }
  19. /// <summary>The UTC DateTime after which the certificate is not valid.</summary>
  20. DateTime NotAfter { get; }
  21. /// <summary>The holder of the certificate.</summary>
  22. AttributeCertificateHolder Holder { get; }
  23. /// <summary>The issuer details for the certificate.</summary>
  24. AttributeCertificateIssuer Issuer { get; }
  25. /// <summary>Return the attributes contained in the attribute block in the certificate.</summary>
  26. /// <returns>An array of attributes.</returns>
  27. X509Attribute[] GetAttributes();
  28. /// <summary>Return the attributes with the same type as the passed in oid.</summary>
  29. /// <param name="oid">The object identifier we wish to match.</param>
  30. /// <returns>An array of matched attributes, null if there is no match.</returns>
  31. X509Attribute[] GetAttributes(string oid);
  32. bool[] GetIssuerUniqueID();
  33. bool IsValidNow { get; }
  34. bool IsValid(DateTime date);
  35. void CheckValidity();
  36. void CheckValidity(DateTime date);
  37. byte[] GetSignature();
  38. void Verify(AsymmetricKeyParameter publicKey);
  39. /// <summary>Return an ASN.1 encoded byte array representing the attribute certificate.</summary>
  40. /// <returns>An ASN.1 encoded byte array.</returns>
  41. /// <exception cref="IOException">If the certificate cannot be encoded.</exception>
  42. byte[] GetEncoded();
  43. }
  44. }
  45. #pragma warning restore
  46. #endif