Package com.wibu.CodeMeter
Class CodeMeter.CMBASECRYPT2
- java.lang.Object
-
- com.wibu.CodeMeter.CodeMeter.CMBASECRYPT2
-
- Enclosing class:
- CodeMeter
public static class CodeMeter.CMBASECRYPT2 extends java.lang.ObjectCMBASECRYPT2 stores all needed parameters needed for every possible en- or decryption. CMBASECRYPT2 is supported since CodeMeter 4.30.
-
-
Field Summary
Fields Modifier and Type Field Description longcrccrc contains the CRC value of the current operation.longctrlctrl contains commands and flags influencing the en- or decryption.longencryptionCodeencryptionCode contains the Encryption Code set by the user.longencryptionCodeOptionsencryptionCodeOptions contains one or more of the following flags: CM_CRYPT_RES1MASK reserved for future use. CM_CRYPT_UCMASK specifies all flags for the Unit Counter options. CM_CRYPT_UCCHECK specifies that the Unit Counter is checked and reduced if available as Product Item Option. CM_CRYPT_UCIGNORE specifies that the Unit Counter is neither checked nor reduced, independent of its availability as Product Item Option. CM_CRYPT_UCREQUIRED specifies that a Unit Counter is checked and reduced and must be available as Product Item Option. CM_CRYPT_ATMASK specifies all flags for the Activation Time. CM_CRYPT_ATCHECK specifies that the Activation Time is checked if available as Product Item Option. CM_CRYPT_ATIGNORE specifies that the Activation Time is not checked, independent of its availability as Product Item Option. CM_CRYPT_ATREQUIRED specifies that a Activation Time is checked and must be available as Product Item Option. CM_CRYPT_ETMASK specifies all flags for the Expiration Time options. CM_CRYPT_ETCHECK specifies that Expiration Time or Usage Period are checked if available as Product Item Option. CM_CRYPT_ETIGNORE specifies that Expiration Time and Usage Period are not checked, independent of its availability as Product Item Option. CM_CRYPT_ETREQUIRED specifies that Expiration Time or Usage Period are checked and one of them must be available as Product Item Option. CM_CRYPT_CERTTIME specifies that the Certified Box Clock (CBC) has to be updated by a Certified Time Stamp (CTS) since the CmDongle has received power.longfeatureCodefeatureCode specifies the Feature Code mapping for the existing Feature Map.longkeyExtTypekeyExtType specifies the key source if the encryption is done with a Hidden Data or a Secret Data.CodeMeter.CMTIMEreleaseDatereleaseDate specifies the Release Date in a CMTIME structure that has to map to the existing Maintenance Period.
-
Constructor Summary
Constructors Constructor Description CMBASECRYPT2()
-
-
-
Field Detail
-
ctrl
public long ctrl
ctrl contains commands and flags influencing the en- or decryption. The parameter can use the following flags:- Used Key:
- CM_CRYPT_FIRMKEY specifies that the encryption key is stored in the Firm Key of a Firm Item.
- CM_CRYPT_HIDDENDATA specifies that the encryption key is stored in a Hidden Data of a Product Item. The Key Source must also be specified here.
- CM_CRYPT_SECRETDATA specifies that the encryption key is stored in a Secret Data of a Product Item. The Key Source must also be specified here.
- Used Encryption Algorithm:
- CM_CRYPT_AES specifies that the Advanced Encryption Standard (AES) algorithm is used for encryption. The key may be CM_CRYPT_FIRMKEY, CM_CRYPT_HIDDENDATA or CM_CRYPT_SECRETDATA. The encryption will be affected by other parameters such as Firm Code, Product Code, Encryption Code etc..
- CM_CRYPT_ECIES specifies that the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm is used for encryption. This flag is only allowed for direct encryption (see Encryption Modes).
- CM_CRYPT_ECIES_STD specifies that the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm is used for encryption. This option executes the standard ECIES. This flag only works with direct encryption. Encryption only works with simulated encryption (CmCryptSim2). The length of the buffer must be at least 64 bytes (CM_PUBLIC_KEY_LEN) larger than the input sequence to add the public key after the encrypted sequence. Decryption only works with real decryption (CmCrypt2). Though the returned length is 64 bytes smaller than the input sequence. This flag is only valid for direct encryption (see Encryption Modes)
- CM_CRYPT_AES_DIRECT specifies that the direct Advanced Encryption Standard (AES) algorithm is used for encryption without hash calculation. The length of the buffer must be at least 16 bytes. The key to use may be CM_CRYPT_HIDDENDATA or CM_CRYPT_SECRETDATA. CM_CRYPT_FIRMKEY is not implemented. This algorithm is compatible to standard AES. Required CmDongle Firmware: 1.10.
- CM_CRYPT_RSA specifies that the standard RSA algorithm is used. The
length of the buffer must be at least 128 bytes (CM_RSA1024_KEY_LEN). The
keys must be located in a Secret Data entry of a Firm-/Product Code:
- d (private key) in SecretData ExtType 130
- p (secret prime) in SecretData ExtType 131
- q (secret prime) in SecretData ExtType 132
- CRC calculation:
- CM_CRYPT_CHKCRC specifies that the CRC value stored in mulCrc should be checked using the CRC of the current operation.
- CM_CRYPT_CALCCRC specifies that the CRC of the current operation should be calculated and stored in mulCrc.
- Used Key:
-
keyExtType
public long keyExtType
keyExtType specifies the key source if the encryption is done with a Hidden Data or a Secret Data.
-
encryptionCode
public long encryptionCode
encryptionCode contains the Encryption Code set by the user.
-
encryptionCodeOptions
public long encryptionCodeOptions
encryptionCodeOptions contains one or more of the following flags:- CM_CRYPT_RES1MASK reserved for future use.
- CM_CRYPT_UCMASK specifies all flags for the Unit Counter options.
- CM_CRYPT_UCCHECK specifies that the Unit Counter is checked and reduced if available as Product Item Option.
- CM_CRYPT_UCIGNORE specifies that the Unit Counter is neither checked nor reduced, independent of its availability as Product Item Option.
- CM_CRYPT_UCREQUIRED specifies that a Unit Counter is checked and reduced and must be available as Product Item Option.
- CM_CRYPT_ATMASK specifies all flags for the Activation Time.
- CM_CRYPT_ATCHECK specifies that the Activation Time is checked if available as Product Item Option.
- CM_CRYPT_ATIGNORE specifies that the Activation Time is not checked, independent of its availability as Product Item Option.
- CM_CRYPT_ATREQUIRED specifies that a Activation Time is checked and must be available as Product Item Option.
- CM_CRYPT_ETMASK specifies all flags for the Expiration Time options.
- CM_CRYPT_ETCHECK specifies that Expiration Time or Usage Period are checked if available as Product Item Option.
- CM_CRYPT_ETIGNORE specifies that Expiration Time and Usage Period are not checked, independent of its availability as Product Item Option.
- CM_CRYPT_ETREQUIRED specifies that Expiration Time or Usage Period are checked and one of them must be available as Product Item Option.
- CM_CRYPT_CERTTIME specifies that the Certified Box Clock (CBC) has to be updated by a Certified Time Stamp (CTS) since the CmDongle has received power. This option is only evaluated if an Expiration Time Product Item Option is available.
- CM_CRYPT_FACDECREMENT specifies that the Access Counter is reduced by 1.
- CM_CRYPT_MPREQUIRED specifies that a Maintenance Period is checked and must be available as Product Item Option.
- CM_CRYPT_TOPLAINONLY specifies that the CmContainer can execute only the decryption but not the encryption variant. This flag can only be used in combination with the CmCrypt2 flag CM_CRYPT_DIRECT_DEC. The corresponding encryption has to be done by using CmCryptSim2.
- CM_CRYPT_RES2MASK reserved for future use.
- CM_CRYPT_SAMASK specifies all flags for network access. These bits are not interpreted by the CmContainer but influence the encryption.
- CM_CRYPT_SAEXCLUSIVE specifies that the current access is done using Exclusive Mode.
- CM_CRYPT_SAUNLIMITED specifies that the current access is done using No User Limit.
- CM_CRYPT_SAUSERLIMIT specifies that the current access is done using User Limit.
- CM_CRYPT_SASTATIONSHARE specifies that the current access is done using Stationshare Mode.
- CM_CRYPT_RES3MASK reserved for future use.
- CM_CRYPT_UCDELTAMASK contains the mask to specify the delta value to reduce the Unit Counter value during encryption. The value is limited to the range of 0 to 9999, values between 10000 and 16383 are reserved for future use.
-
featureCode
public long featureCode
featureCode specifies the Feature Code mapping for the existing Feature Map. The operation fails if the Feature Code contains bits which do not exist in the Feature Map.
-
releaseDate
public CodeMeter.CMTIME releaseDate
releaseDate specifies the Release Date in a CMTIME structure that has to map to the existing Maintenance Period. The operation fails if the Release Date is not in the Maintenance Period.
-
crc
public long crc
crc contains the CRC value of the current operation. It depends on the CM_CRYPT_CALCCRC or CM_CRYPT_CHKCRC flags if this value is set or checked.
-
-