com.ibm.jc
Class LoadToken

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

public class LoadToken
extends java.lang.Object

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


Constructor Summary
LoadToken(byte[] signature, byte[] sha, byte[] sdaid, byte[] loadParams, byte[] pkgAID, java.lang.Object cert)
          Constructs a Load Token object.
LoadToken(byte[] ltInfo, int off, int len)
          Constructs a Load Token object based on the Load Token information saved in a CAP file.
 
Method Summary
 byte[] getCapInfo()
          Encodes Load Token info as it's saved in CAP-files.
 java.lang.Object getCert()
          Returns the public certificate.
 byte[] getLoadParams()
          Returns the load parameters the package will be loaded with.
 java.lang.String getLoadParamsString()
          Returns the load parameters the package will be loaded with as HEX String.
 byte[] getPkgAID()
          Returns the AID of the package to load.
 java.lang.String getPkgAIDString()
          Returns the AID of the package to load as a HEX string.
 byte[] getSDAID()
          Returns the AID of the Security Domain the package will be associated with.
 java.lang.String getSDAIDString()
          Returns the AID of the Security Domain the package will be associated with as HEX String.
 byte[] getSHA()
          Returns the SHA digest over the Load File
 java.lang.String getSHAString()
          Returns the SHA digest over the Load File as a HEX string.
 byte[] getSignature()
          Returns the Load Token.
 java.lang.String getSignatureString()
          Returns the Load Token as HEX string.
 SSLName getSigner()
          Returns info about the Load Token generator.
 void setCert(java.lang.Object cert)
          Sets the public certificate.
 void setSignature(byte[] sig)
          Sets the Load Token (signature).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadToken

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

Parameters:
ltInfo - Info from the CAP file. The format is signature|sha|L|sdaid|L|loadParams|L|pkgAID|[X.509 cert] where L is the length byte for the following component.
off - offset in ltInfo.
len - length of Load Token information.

LoadToken

public LoadToken(byte[] signature,
                 byte[] sha,
                 byte[] sdaid,
                 byte[] loadParams,
                 byte[] pkgAID,
                 java.lang.Object cert)
          throws JCException
Constructs a Load Token object.

Parameters:
signature - the Load Token.
sha - load file hash.
sdaid - Security Domain AID
loadParams - load parameters (raw format)
pkgAID - package AID.
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 Load Token info as it's saved in CAP-files.

Returns:
Load 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 Load 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 Load Token.

Returns:
1024 bit RSA signature.

setSignature

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

Parameters:
sig - the Load Token.
Throws:
JCException

getSignatureString

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

Returns:
the string.

getSHA

public byte[] getSHA()
Returns the SHA digest over the Load File

Returns:
the SHA digest.

getSHAString

public java.lang.String getSHAString()
Returns the SHA digest over the Load File as a HEX string.

Returns:
the HEX string.

getPkgAID

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

Returns:
the package AID.

getPkgAIDString

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

Returns:
the HEX string.

getSDAID

public byte[] getSDAID()
Returns the AID of the Security Domain the package will be associated with.

Returns:
the Security Domain AID or null.

getSDAIDString

public java.lang.String getSDAIDString()
Returns the AID of the Security Domain the package will be associated with as HEX String.

Returns:
the HEX String or null.

getLoadParams

public byte[] getLoadParams()
Returns the load parameters the package will be loaded with.

Returns:
the load parametes (raw format) or null.

getLoadParamsString

public java.lang.String getLoadParamsString()
Returns the load parameters the package will be loaded with as HEX String.

Returns:
the HEX String or null.