CryptoException.java revision e6bf3e8dfa2804891a82075cb469b736321b4827
1package org.bouncycastle.crypto;
2
3/**
4 * the foundation class for the hard exceptions thrown by the crypto packages.
5 */
6public class CryptoException
7    extends Exception
8{
9    private Throwable cause;
10
11    /**
12     * base constructor.
13     */
14    public CryptoException()
15    {
16    }
17
18    /**
19     * create a CryptoException with the given message.
20     *
21     * @param message the message to be carried with the exception.
22     */
23    public CryptoException(
24        String  message)
25    {
26        super(message);
27    }
28
29    /**
30     * Create a CryptoException with the given message and underlying cause.
31     *
32     * @param message message describing exception.
33     * @param cause the throwable that was the underlying cause.
34     */
35    public CryptoException(
36        String  message,
37        Throwable cause)
38    {
39        super(message);
40
41        this.cause = cause;
42    }
43
44    public Throwable getCause()
45    {
46        return cause;
47    }
48}
49