javacardx.io
Class PSKException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by javacardx.io.PSKException

@TransactionType(value=NOT_SUPPORTED)
public class PSKException
extends IOException

The PSKException encapsulates an error that occurred while establishing a TLS secure connection using a PSK cipher suite.

This exception as CertificateException is a subtype of IOException. PSKException must be thrown in lieu of CertificateException when PSK is used to indicate various failures related to establishing the secure connection.

Direct instances of this exception class are not bound to any context and can be passed between contexts without any restrictions. Objects created and returned by the methods of this class are owned by the caller. In particular, a call to the Throwable.getMessage() returns a String instance bound to the owner context of the caller.

See Runtime Environment Specification for the Java Card Platform, Connected Edition, chapter 7 for details regarding transfer of ownership.

Since:
Java Card 3.0
See Also:
HttpsConnection, SecureConnection, CertificateException

Field Summary
static byte UNKNOWN_PSK_IDENTITY
          This reason code is used to indicate that the server did not recognize the PSK identity.
 
Constructor Summary
PSKException(byte reason)
          Create a new exception with a specific error reason.
PSKException(String message, byte reason)
          Create a new exception with a message and specific error reason.
 
Method Summary
 byte getReason()
          Get the reason code.
 
Methods inherited from class java.lang.Throwable
getMessage, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_PSK_IDENTITY

public static final byte UNKNOWN_PSK_IDENTITY
This reason code is used to indicate that the server did not recognize the PSK identity. The value is 1.

See Also:
Constant Field Values
Constructor Detail

PSKException

public PSKException(byte reason)
Create a new exception with a specific error reason. The descriptive message for the new exception will be automatically provided, based on the reason.

Parameters:
reason - the reason for the exception.

PSKException

public PSKException(String message,
                    byte reason)
Create a new exception with a message and specific error reason.

Parameters:
message - a descriptive message
reason - the reason for the exception.
Method Detail

getReason

public byte getReason()
Get the reason code.

Returns:
the reason code


Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.