ccs.cpc.impl
Class CpcLicence

java.lang.Object
  extended by ccs.beetree.BeeObject
      extended by ccs.cdb.CDBObject
          extended by ccs.cpc.impl.CpcLicence
All Implemented Interfaces:
java.io.Serializable

public class CpcLicence
extends ccs.cdb.CDBObject

Registration information for this Checkpoint installation. Who owns it, basically.

See Also:
Serialized Form

Field Summary
 java.lang.String licenseKey
          The license key.
static java.lang.String LICENSEVERSION
          The version for licensing purposes.
static int NHASH
          The registration contains 112 bits of hash (14 bytes).
static int NSALT
          The registration contains 48 bits of salt (6 bytes).
 java.lang.String ownerOrg
          The organisation this is registered to.
 java.lang.String ownerPerson
          The person this is registered to.
 
Fields inherited from class ccs.cdb.CDBObject
clone, key, marshalVersion, owner
 
Fields inherited from class ccs.beetree.BeeObject
cipher, encodedLength, isBodiless, isForceDirectDecrypt, isZip, slack
 
Constructor Summary
CpcLicence()
           
 
Method Summary
 void check()
          Check that the registration key is valid.
protected  void cpmarshal(java.io.DataOutputStream dest)
          override this to marshal your data, just like marshal.
protected  void cpunmarshal(java.io.DataInputStream src, int marshalver)
          override this to unmarshal your data, just like unmarshal.
protected  byte[] generateMAC(byte[] salt)
          Generate the hash value.
 boolean isValid()
          Whether the registration key is valid.
 
Methods inherited from class ccs.cdb.CDBObject
canChangeKeyProgrammatically, canDeleteProgrammatically, canUpdateProgrammatically, cpgetKey, cpgetMarshalledLength, cppreMarshal, cppreUnmarshal, cpsetKey, getCDB, getKey, getMarshalledLength, marshal, preMarshal, preUnmarshal, setCDB, setKey, transientMarshal, transientUnmarshal, unmarshal
 
Methods inherited from class ccs.beetree.BeeObject
lock, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NSALT

public static final int NSALT
The registration contains 48 bits of salt (6 bytes).

See Also:
Constant Field Values

NHASH

public static final int NHASH
The registration contains 112 bits of hash (14 bytes). NB. (NSALT + NHASH) must be divisible by 5.

See Also:
Constant Field Values

LICENSEVERSION

public static final java.lang.String LICENSEVERSION
The version for licensing purposes. Change this to require users to get new licenses.

See Also:
Constant Field Values

ownerPerson

public java.lang.String ownerPerson
The person this is registered to. For a shrink-wrapped (boxed) copy, this will be the empty string.


ownerOrg

public java.lang.String ownerOrg
The organisation this is registered to. For a shrink-wrapped (boxed) copy, this will be the empty string.


licenseKey

public java.lang.String licenseKey
The license key.

Constructor Detail

CpcLicence

public CpcLicence()
Method Detail

isValid

public boolean isValid()
Whether the registration key is valid.


check

public void check()
Check that the registration key is valid.

Throws:
java.lang.IllegalArgumentException - If the registration key is no good.

generateMAC

protected byte[] generateMAC(byte[] salt)
Generate the hash value.

Parameters:
salt - The first NSALT bytes of this are used as salt.
Returns:
The hash value. Only the first NHASH bytes of this are used.

cpmarshal

protected void cpmarshal(java.io.DataOutputStream dest)
                  throws java.io.IOException
Description copied from class: ccs.cdb.CDBObject
override this to marshal your data, just like marshal. The data will be in the object's fields when this is called (rather than within any UI objects).

Specified by:
cpmarshal in class ccs.cdb.CDBObject
Parameters:
dest - The stream to marshal onto.
Throws:
java.io.IOException - If this breaks (breaks the CDB too).

cpunmarshal

protected void cpunmarshal(java.io.DataInputStream src,
                           int marshalver)
                    throws java.io.IOException
Description copied from class: ccs.cdb.CDBObject
override this to unmarshal your data, just like unmarshal.

Specified by:
cpunmarshal in class ccs.cdb.CDBObject
Parameters:
src - The stream to unmarshal from
marshalver - The marshal version of the data in src - i.e. the version of this class which wrote the data. This may be different from the current marshalVersion. If so (i.e. the stored data is the wrong version) your method should allow for it. This allows comparatively painless data migration between versions of your objects.
Throws:
java.io.IOException - if this breaks (breaks the CDB too).