public class ValidationListDataToEncrypt extends ValidationListTranslatedData
Constructor and Description |
---|
ValidationListDataToEncrypt()
Constructs a ValidationListDataToEncrypt.
|
ValidationListDataToEncrypt(byte[] buffer,
int offset)
Constructs a ValidationListDataToEncrypt from a structure stored as IBM i bytes.
|
ValidationListDataToEncrypt(int ccsid,
byte[] bytes)
Constructs a ValidationListDataToEncrypt from the specified IBM i bytes
which are encoded in the given ccsid.
|
ValidationListDataToEncrypt(java.lang.String s,
int ccsid,
AS400 as400)
Constructs a ValidationListDataToEncrypt from the given string.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getWriteNullDataLength()
Returns the length to be specified in the written IBM i byte structure
if the assigned data is null.
|
getByteLength, getBytes, getCcsid, getReadOffsetCcsid, getReadOffsetTByteLength, getReadOffsetTBytes, getString, getWriteOffsetCcsid, getWriteOffsetTByteLength, getWriteOffsetTBytes, isValidCcsid, setBytes, setBytes, setCcsid, toBytes, toBytes
public ValidationListDataToEncrypt()
public ValidationListDataToEncrypt(byte[] buffer, int offset)
The offset indicates the starting position of the structure in the given buffer.
buffer
- byte[]offset
- intpublic ValidationListDataToEncrypt(int ccsid, byte[] bytes)
ccsid
- intbytes
- byte[]public ValidationListDataToEncrypt(java.lang.String s, int ccsid, AS400 as400)
The translated bytes are derived by converting the string to IBM i bytes using the given ccsid. The as400 is required to perform the conversion from text to bytes. A ccsid of 0 indicates to use the ccsid of the current user.
s
- java.lang.Stringccsid
- intas400
- com.ibm.as400.access.AS400protected int getWriteNullDataLength()
Typically this value is 0. However, there are some cases where other values must be returned to maintain proper behavior. For example, when changing an entry a structure must be specified for the data to encrypt, even if the encrypted data should not be changed. However, if the data length in the structure is set to 0 instead of -1, the existing encrypted data is wiped out. This is undesirable since we don't always want the encrypted data changed. We might want to modify the unencrypted data (i.e. user statistics) while leaving the encrypted data (i.e. user password) unchanged.
getWriteNullDataLength
in class ValidationListTranslatedData