AuthenticatorControl.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /// <summary>
  9. /// Carrier for an authenticator control.
  10. /// </summary>
  11. public class AuthenticatorControl
  12. : IControl
  13. {
  14. private static readonly DerObjectIdentifier type = CrmfObjectIdentifiers.id_regCtrl_authenticator;
  15. private readonly DerUtf8String token;
  16. /// <summary>
  17. /// Basic constructor - build from a UTF-8 string representing the token.
  18. /// </summary>
  19. /// <param name="token">UTF-8 string representing the token.</param>
  20. public AuthenticatorControl(DerUtf8String token)
  21. {
  22. this.token = token;
  23. }
  24. /// <summary>
  25. /// Basic constructor - build from a string representing the token.
  26. /// </summary>
  27. /// <param name="token">string representing the token.</param>
  28. public AuthenticatorControl(string token)
  29. {
  30. this.token = new DerUtf8String(token);
  31. }
  32. /// <summary>
  33. /// Return the type of this control.
  34. /// </summary>
  35. public DerObjectIdentifier Type
  36. {
  37. get { return type; }
  38. }
  39. /// <summary>
  40. /// Return the token associated with this control (a UTF8String).
  41. /// </summary>
  42. public Asn1Encodable Value
  43. {
  44. get { return token; }
  45. }
  46. }
  47. }
  48. #pragma warning restore
  49. #endif