IAIK TSP
version 2.32

iaik.tsp
Class PKIFailureInfo

java.lang.Object
  extended by iaik.tsp.PKIFailureInfo

public class PKIFailureInfo
extends java.lang.Object

This class implements the TSP ASN.1 type PKIFailureInfo as it is specified in RFC 3161.

 PKIFailureInfo ::= BIT STRING {
     badAlg (0),
         -- unrecognized or unsupported Algorithm Identifier
     badRequest (2),
         -- transaction not permitted or supported
     badDataFormat (5),
         -- the data submitted has the wrong format
     timeNotAvailable (14),
         -- the TSA's time source is not available
     unacceptedPolicy (15),
         -- the requested TSA policy is not supported by the TSA.
     unacceptedExtension (16),
         -- the requested extension is not supported by the TSA.
     addInfoNotAvailable (17),
         -- the additional information requested could not be understood
         -- or is not available
     systemFailure (25)
         -- the request cannot be handled due to system failure
 }
 

This class handles the ASN.1 structure and the DER encoding and decoding of this structure.


Field Summary
static java.lang.String ADD_INFO_NOT_AVAILABLE
          The bit string representation of an addInfoNotAvailable failure
protected static java.lang.String ADD_INFO_NOT_AVAILABLE_TEXT
          The message sent for a addInfoNotAvailable failure
static java.lang.String BAD_ALG
          The bit string representation of a badAlg failure
protected static java.lang.String BAD_ALG_TEXT
          The message sent for a badAlg failure
static java.lang.String BAD_DATA_FORMAT
          The bit string representation of a badDataFormat failure
protected static java.lang.String BAD_DATA_FORMAT_TEXT
          The message sent for a badDataFormat failure
static java.lang.String BAD_REQUEST
          The bit string representation of a badRequest failure
protected static java.lang.String BAD_REQUEST_TEXT
          The message sent for a badRequest failure
static java.lang.String SYSTEM_FAILURE
          The bit string representation of a systemFailure failure
protected static java.lang.String SYSTEM_FAILURE_TEXT
          The message sent for a systemFailure failure
static java.lang.String TIME_NOT_AVAILABLE
          The bit string representation of a timeNotAvailable failure
protected static java.lang.String TIME_NOT_AVAILABLE_TEXT
          The message sent for a timeNotAvailable failure
static java.lang.String UNACCEPTED_EXTENSION
          The bit string representation of an unacceptedExtension failure
protected static java.lang.String UNACCEPTED_EXTENSION_TEXT
          The message sent for a unacceptedExtension failure
static java.lang.String UNACCEPTED_POLICY
          The bit string representation of an unacceptedPolicy failure
protected static java.lang.String UNACCEPTED_POLICY_TEXT
          The message sent for a unacceptedPolicy failure
 
Constructor Summary
PKIFailureInfo(ASN1Object component)
          This constructor tries to reconstruct a PKIFailureInfo object from the given ASN.1 structure.
PKIFailureInfo(java.lang.String failure_info)
          To construct a new PKIFailureInfo object with the given failure code.
 
Method Summary
 byte[] getEncoded()
          This method DER encodes the ASN.1 PKIFailureInfo object.
 java.lang.String getFailureInfo()
          This method returns the failure code.
 void setFailureInfo(java.lang.String failure_info)
          This method sets a new failure code.
protected  void testFailureInfoBounds(java.lang.String failure_info)
          This method checks if the given value is TSP conform.
 ASN1Object toASN1Object()
          Returns the ASN.1 structure of the PKIFailureInfo object.
 java.lang.String toString()
          This method returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAD_ALG

public static final java.lang.String BAD_ALG
The bit string representation of a badAlg failure

See Also:
Constant Field Values

BAD_REQUEST

public static final java.lang.String BAD_REQUEST
The bit string representation of a badRequest failure

See Also:
Constant Field Values

BAD_DATA_FORMAT

public static final java.lang.String BAD_DATA_FORMAT
The bit string representation of a badDataFormat failure

See Also:
Constant Field Values

TIME_NOT_AVAILABLE

public static final java.lang.String TIME_NOT_AVAILABLE
The bit string representation of a timeNotAvailable failure

See Also:
Constant Field Values

UNACCEPTED_POLICY

public static final java.lang.String UNACCEPTED_POLICY
The bit string representation of an unacceptedPolicy failure

See Also:
Constant Field Values

UNACCEPTED_EXTENSION

public static final java.lang.String UNACCEPTED_EXTENSION
The bit string representation of an unacceptedExtension failure

See Also:
Constant Field Values

ADD_INFO_NOT_AVAILABLE

public static final java.lang.String ADD_INFO_NOT_AVAILABLE
The bit string representation of an addInfoNotAvailable failure

See Also:
Constant Field Values

SYSTEM_FAILURE

public static final java.lang.String SYSTEM_FAILURE
The bit string representation of a systemFailure failure

See Also:
Constant Field Values

BAD_ALG_TEXT

protected static final java.lang.String BAD_ALG_TEXT
The message sent for a badAlg failure

See Also:
Constant Field Values

BAD_REQUEST_TEXT

protected static final java.lang.String BAD_REQUEST_TEXT
The message sent for a badRequest failure

See Also:
Constant Field Values

BAD_DATA_FORMAT_TEXT

protected static final java.lang.String BAD_DATA_FORMAT_TEXT
The message sent for a badDataFormat failure

See Also:
Constant Field Values

TIME_NOT_AVAILABLE_TEXT

protected static final java.lang.String TIME_NOT_AVAILABLE_TEXT
The message sent for a timeNotAvailable failure

See Also:
Constant Field Values

UNACCEPTED_POLICY_TEXT

protected static final java.lang.String UNACCEPTED_POLICY_TEXT
The message sent for a unacceptedPolicy failure

See Also:
Constant Field Values

UNACCEPTED_EXTENSION_TEXT

protected static final java.lang.String UNACCEPTED_EXTENSION_TEXT
The message sent for a unacceptedExtension failure

See Also:
Constant Field Values

ADD_INFO_NOT_AVAILABLE_TEXT

protected static final java.lang.String ADD_INFO_NOT_AVAILABLE_TEXT
The message sent for a addInfoNotAvailable failure

See Also:
Constant Field Values

SYSTEM_FAILURE_TEXT

protected static final java.lang.String SYSTEM_FAILURE_TEXT
The message sent for a systemFailure failure

See Also:
Constant Field Values
Constructor Detail

PKIFailureInfo

public PKIFailureInfo(java.lang.String failure_info)
               throws java.lang.IllegalArgumentException
To construct a new PKIFailureInfo object with the given failure code.

Parameters:
failure_info - The failure info code.
Throws:
java.lang.IllegalArgumentException - Thrown If the argument is not a TSP conform value.

PKIFailureInfo

public PKIFailureInfo(ASN1Object component)
               throws CodingException
This constructor tries to reconstruct a PKIFailureInfo object from the given ASN.1 structure.

Parameters:
component - The ASN.1 structure.
Throws:
CodingException - Thrown if the given ASN1Object is not a PKIFailureInfo ASN.1 object.
Method Detail

getEncoded

public byte[] getEncoded()
This method DER encodes the ASN.1 PKIFailureInfo object.

Returns:
DER encoded PKIFailureInfo object.

toASN1Object

public ASN1Object toASN1Object()
Returns the ASN.1 structure of the PKIFailureInfo object.

Returns:
ASN1Object of the PKIFailureInfo object.

setFailureInfo

public void setFailureInfo(java.lang.String failure_info)
                    throws java.lang.IllegalArgumentException
This method sets a new failure code.

Parameters:
failure_info - One of the above described failure info strings.
Throws:
java.lang.IllegalArgumentException - Thrown if the argument is not a TSP conform value.

getFailureInfo

public java.lang.String getFailureInfo()
This method returns the failure code.

Returns:
The failure code.

toString

public java.lang.String toString()
This method returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representing the PKIFailureInfo object.

testFailureInfoBounds

protected void testFailureInfoBounds(java.lang.String failure_info)
                              throws java.lang.IllegalArgumentException
This method checks if the given value is TSP conform.

Parameters:
failure_info - Value to check.
Throws:
java.lang.IllegalArgumentException - Thrown if the given value is not TSP conform.

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK TSP, © 2002 IAIK, © 2003 - 2014 Stiftung SIC