From 176743ab5faec2dd275b5efd3a2dd62c610f237a Mon Sep 17 00:00:00 2001 From: Oren Novotny Date: Wed, 26 Feb 2014 10:08:50 -0500 Subject: Add BouncyCastle PCL files --- Crypto/src/tsp/TSPValidationException.cs | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Crypto/src/tsp/TSPValidationException.cs (limited to 'Crypto/src/tsp/TSPValidationException.cs') diff --git a/Crypto/src/tsp/TSPValidationException.cs b/Crypto/src/tsp/TSPValidationException.cs new file mode 100644 index 000000000..d8243e65f --- /dev/null +++ b/Crypto/src/tsp/TSPValidationException.cs @@ -0,0 +1,39 @@ +namespace Org.BouncyCastle.Tsp +{ + /** + * Exception thrown if a TSP request or response fails to validate. + *

+ * If a failure code is associated with the exception it can be retrieved using + * the getFailureCode() method.

+ */ + public class TspValidationException + : TspException + { + private int failureCode; + + public TspValidationException( + string message) + : base(message) + { + this.failureCode = -1; + } + + public TspValidationException( + string message, + int failureCode) + : base(message) + { + this.failureCode = failureCode; + } + + /** + * Return the failure code associated with this exception - if one is set. + * + * @return the failure code if set, -1 otherwise. + */ + public int FailureCode + { + get { return failureCode; } + } + } +} -- cgit 1.5.1