RegTokenControl.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crmf
  7. {
  8. public class RegTokenControl
  9. : IControl
  10. {
  11. private static readonly DerObjectIdentifier type = CrmfObjectIdentifiers.id_regCtrl_regToken;
  12. private readonly DerUtf8String token;
  13. /// <summary>
  14. /// Basic constructor - build from a UTF-8 string representing the token.
  15. /// </summary>
  16. /// <param name="token">UTF-8 string representing the token.</param>
  17. public RegTokenControl(DerUtf8String token)
  18. {
  19. this.token = token;
  20. }
  21. /// <summary>
  22. /// Basic constructor - build from a string representing the token.
  23. /// </summary>
  24. /// <param name="token">string representing the token.</param>
  25. public RegTokenControl(string token)
  26. {
  27. this.token = new DerUtf8String(token);
  28. }
  29. /// <summary>
  30. /// Return the type of this control.
  31. /// </summary>
  32. /// <returns>CRMFObjectIdentifiers.id_regCtrl_regToken</returns>
  33. public DerObjectIdentifier Type
  34. {
  35. get { return type; }
  36. }
  37. /// <summary>
  38. /// Return the token associated with this control (a UTF8String).
  39. /// </summary>
  40. /// <returns>a UTF8String.</returns>
  41. public Asn1Encodable Value
  42. {
  43. get { return token; }
  44. }
  45. }
  46. }
  47. #pragma warning restore
  48. #endif