TSPValidationException.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
  5. {
  6. /**
  7. * Exception thrown if a TSP request or response fails to validate.
  8. * <p>
  9. * If a failure code is associated with the exception it can be retrieved using
  10. * the getFailureCode() method.</p>
  11. */
  12. #if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE)
  13. [Serializable]
  14. #endif
  15. public class TspValidationException
  16. : TspException
  17. {
  18. private int failureCode;
  19. public TspValidationException(
  20. string message)
  21. : base(message)
  22. {
  23. this.failureCode = -1;
  24. }
  25. public TspValidationException(
  26. string message,
  27. int failureCode)
  28. : base(message)
  29. {
  30. this.failureCode = failureCode;
  31. }
  32. /**
  33. * Return the failure code associated with this exception - if one is set.
  34. *
  35. * @return the failure code if set, -1 otherwise.
  36. */
  37. public int FailureCode
  38. {
  39. get { return failureCode; }
  40. }
  41. }
  42. }
  43. #pragma warning restore
  44. #endif