com.ibm.jc
Class DAPBlock

java.lang.Object
  extended bycom.ibm.jc.DAPBlock

public class DAPBlock
extends java.lang.Object

Represents a DAP block as defined in Global Platform and as we save it in a CAP-file. In the latter case the X.509 public certificate is included if available.


Field Summary
static int DES_DAP_ALG_201
          DES DAP algorithm as defined in VOP 2.0.1'
static int DES_DAP_ALG_211
          DES DAP algorithm as defined in GP 2.1.1
static int PK_DAP_ALG
          PK DAP algorithm
 
Constructor Summary
DAPBlock(byte[] aid, byte[] sig, java.lang.Object cert)
          Deprecated.  
DAPBlock(byte[] aid, byte[] sig, java.lang.Object cert, int alg)
          Constructs a DAP block.
DAPBlock(byte[] dapInfo, int off, int len)
          Constructs a DAP block object based on the DAP information saved in a CAP file.
 
Method Summary
 byte[] getAID()
          Returns the AID of the Security Domain which is supposed to verify this DAP.
 java.lang.String getAIDString()
          Returns the AID of the Security Domain which is supposed to verify this DAP as a HEX string.
 byte[] getCapInfo()
          Encodes DAP info as it is saved in CAP-files.
 java.lang.Object getCert()
          Returns the public certificate.
 int getDAPAlgorithm()
          Returns the DAP generation algorithm.
 byte[] getEncoded()
          Builds a DAP block as defined in Global Platform.
 byte[] getSignature()
          Returns the DAP.
 java.lang.String getSignatureString()
          Returns the DAP as HEX string.
 SSLName getSigner()
          Returns info about the DAP generator.
 void setAID(byte[] aid)
          Sets the AID of the Security Domain which is supposed to verify this DAP.
 void setCert(java.lang.Object cert)
          Sets the public certificate.
 void setSignature(byte[] sig)
          Sets the DAP (signature).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DES_DAP_ALG_201

public static final int DES_DAP_ALG_201
DES DAP algorithm as defined in VOP 2.0.1'

See Also:
Constant Field Values

DES_DAP_ALG_211

public static final int DES_DAP_ALG_211
DES DAP algorithm as defined in GP 2.1.1

See Also:
Constant Field Values

PK_DAP_ALG

public static final int PK_DAP_ALG
PK DAP algorithm

See Also:
Constant Field Values
Constructor Detail

DAPBlock

public DAPBlock(byte[] dapInfo,
                int off,
                int len)
         throws JCException
Constructs a DAP block object based on the DAP information saved in a CAP file.

Parameters:
dapInfo - Info from the CAP file. The format is algorithm | DAP-block | [X.509 cert].
off - offset in dapInfo.
len - length of DAP information.

DAPBlock

public DAPBlock(byte[] aid,
                byte[] sig,
                java.lang.Object cert)
         throws JCException
Deprecated.  

Constructs a DAP block.

Parameters:
aid - AID of the Security Domain to do the DAP verification.
sig - the DAP signature.
cert - optional RSA certificate used to generate the signature, might be null.
See Also:
com.ibm.jc.CapFile.makePrivateCert

DAPBlock

public DAPBlock(byte[] aid,
                byte[] sig,
                java.lang.Object cert,
                int alg)
         throws JCException
Constructs a DAP block.

Parameters:
aid - AID of the Security Domain to do the DAP verification.
sig - the DAP signature.
cert - optional RSA certificate used to generate the signature, might be null.
alg - the DAP generation algorithm used. Only applicable in case of DES DAP, otherwise this parameter is ignored.
See Also:
DES_DAP_ALG_201, DES_DAP_ALG_211, com.ibm.jc.CapFile.makePrivateCert
Method Detail

getEncoded

public byte[] getEncoded()
                  throws JCException
Builds a DAP block as defined in Global Platform.

Returns:
the DAP block.
Throws:
JCException

getCapInfo

public byte[] getCapInfo()
Encodes DAP info as it is saved in CAP-files.

Returns:
DAP info in the format: DAP-block | [X.509 cert].

getDAPAlgorithm

public int getDAPAlgorithm()
Returns the DAP generation algorithm.

Returns:
DAP generation algorithm.
See Also:
DES_DAP_ALG_201, DES_DAP_ALG_211, PK_DAP_ALG

getCert

public java.lang.Object getCert()
Returns the public certificate.

Returns:
the certificate, if any.

setCert

public void setCert(java.lang.Object cert)
Sets the public certificate.

Parameters:
cert - the certificate.

getSignature

public byte[] getSignature()
Returns the DAP.

Returns:
the DES or RSA signature.

setSignature

public void setSignature(byte[] sig)
                  throws JCException
Sets the DAP (signature).

Parameters:
sig - the DAP.
Throws:
JCException

getSignatureString

public java.lang.String getSignatureString()
Returns the DAP as HEX string.

Returns:
the string.

getAID

public byte[] getAID()
Returns the AID of the Security Domain which is supposed to verify this DAP.

Returns:
the AID.

setAID

public void setAID(byte[] aid)
            throws JCException
Sets the AID of the Security Domain which is supposed to verify this DAP.

Parameters:
aid - the AID.
Throws:
JCException

getAIDString

public java.lang.String getAIDString()
Returns the AID of the Security Domain which is supposed to verify this DAP as a HEX string.

Returns:
the AID string.

getSigner

public SSLName getSigner()
Returns info about the DAP generator. If a certificate is available the X.500 distinguished name is returned.

Returns:
the name object, if any.