com.ibm.jc
Class InstallToken

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

public class InstallToken
extends java.lang.Object

Represents an Install Token as defined in VOP and as we save it in a CAP-file. Appart from the the Install Token (signature) itself it also contains the InstallForInstallAndMakeSelectable() parameters for which it has been generated.


Constructor Summary
InstallToken(byte[] signature, byte[] pkgAID, byte[] appAID, byte[] instAID, byte[] instParams, byte privs, java.lang.Object cert)
          Constructs an Install Token object.
InstallToken(byte[] itInfo, int off, int len)
          Constructs a Install Token object based on the Install Token information saved in a CAP file.
 
Method Summary
 byte[] getAppAID()
          Returns the AID of the applet to be installed.
 java.lang.String getAppAIDString()
          Returns the AID of the applet to be installed as a HEX string.
 byte[] getCapInfo()
          Encodes Install Token info as it's saved in CAP-files.
 java.lang.Object getCert()
          Returns the public certificate.
 byte[] getInstAID()
          Returns the desired instance AID.
 java.lang.String getInstAIDString()
          Returns the desired instance AID as HEX string.
 byte[] getInstParams()
          Returns the install parameters (raw format).
 java.lang.String getInstParamsString()
          Returns the install parameters (raw format) as HEX string.
 byte[] getPkgAID()
          Returns the AID of the package to install from.
 java.lang.String getPkgAIDString()
          Returns the AID of the package to install from as a HEX string.
 byte getPrivs()
          Returns the application privileges.
 java.lang.String getPrivsString()
          Returns the application privileges as HEX string.
 byte[] getSignature()
          Returns the Install Token.
 java.lang.String getSignatureString()
          Returns the Install Token as HEX string.
 SSLName getSigner()
          Returns info about the Install Token generator.
 void setCert(java.lang.Object cert)
          Sets the public certificate.
 void setSignature(byte[] sig)
          Sets the Install Token (signature).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstallToken

public InstallToken(byte[] itInfo,
                    int off,
                    int len)
             throws JCException
Constructs a Install Token object based on the Install Token information saved in a CAP file.

Parameters:
itInfo - Info from the CAP file. The format is signature|L|pkgAID|L|appAID|L|instAID|L|instParams|privs|[X.509 cert] where L is the length byte for the following component.
off - offset in itInfo.
len - length of Install Token information.

InstallToken

public InstallToken(byte[] signature,
                    byte[] pkgAID,
                    byte[] appAID,
                    byte[] instAID,
                    byte[] instParams,
                    byte privs,
                    java.lang.Object cert)
             throws JCException
Constructs an Install Token object.

Parameters:
signature - the Install Token.
pkgAID - the package AID.
appAID - the applet AID.
instAID - the instance AID (optional, can be null)
instParams - install parameters (raw format) (optional, can be null)
privs - the application privileges.
cert - optional RSA certificate used to generate the signature, might be null.
See Also:
com.ibm.jc.CapFile.makePrivateCert
Method Detail

getCapInfo

public byte[] getCapInfo()
Encodes Install Token info as it's saved in CAP-files.

Returns:
Install Token info (format see constructor).

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.

getSigner

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

Returns:
the name object, if any.

getSignature

public byte[] getSignature()
Returns the Install Token.

Returns:
1024 bit RSA signature.

setSignature

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

Parameters:
sig - the Install Token.
Throws:
JCException

getSignatureString

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

Returns:
the string.

getPkgAID

public byte[] getPkgAID()
Returns the AID of the package to install from.

Returns:
the package AID.

getPkgAIDString

public java.lang.String getPkgAIDString()
Returns the AID of the package to install from as a HEX string.

Returns:
the HEX string.

getAppAID

public byte[] getAppAID()
Returns the AID of the applet to be installed.

Returns:
the applet AID.

getAppAIDString

public java.lang.String getAppAIDString()
Returns the AID of the applet to be installed as a HEX string.

Returns:
the HEX string.

getInstAID

public byte[] getInstAID()
Returns the desired instance AID.

Returns:
the instance AID or null.

getInstAIDString

public java.lang.String getInstAIDString()
Returns the desired instance AID as HEX string.

Returns:
the HEX String or null.

getInstParams

public byte[] getInstParams()
Returns the install parameters (raw format).

Returns:
the install parameters or null.

getInstParamsString

public java.lang.String getInstParamsString()
Returns the install parameters (raw format) as HEX string.

Returns:
the HEX String or null.

getPrivs

public byte getPrivs()
Returns the application privileges.

Returns:
the application privileges.

getPrivsString

public java.lang.String getPrivsString()
Returns the application privileges as HEX string.

Returns:
the HEX String.