|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mqe.MQe | +--com.ibm.mqe.MQeKey
Used to create an MQeKey object. MQeKey objects can be attached to and used by an attribute object.
Field Summary |
Constructor Summary | |
MQeKey()
Constructs an MQeKey object. |
Method Summary | |
void |
setLocalKey(java.lang.String localCipherKey)
Sets the seed for the key |
Methods inherited from class com.ibm.mqe.MQe |
abbreviate, alias, asciiToByte, byteToAscii, byteToHex, byteToHex, byteToInt, byteToLong, byteToShort, byteToUnicode, fileSeparator, getEventLogHandler, hexToAscii, hexToByte, intToByte, isCLDC, loadClass, loadObject, log, setEventLogHandler, setLoader, sliceByteArray, type, unicodeToByte, uniqueValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MQeKey()
None
MQeAttribute
,
MQeMAttribute
Method Detail |
public void setLocalKey(java.lang.String localCipherKey) throws MQeException
localCipherKey
- Seed from which the key encrypt and decrypt keys are derived.
MQeException
- Except_NotAllowed ,"invalid localCipherKey"MQeLocalSecure
try { // protecting MQeFields data MQeDESCryptor des = new MQeDESCryptor(); MQeAttribute desA = new MQeAttribute(null, des, null); MQeKey localkey = new MQeKey(); localkey.setLocalKey("It_is_a_secret"); desA.setKey(localkey); MQeFields localf = new MQeFields(); localf.setAttribute(desA); byte[] dat = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0}; localf.putArrayOfByte("TestData", dat); byte[]temp = localf.dump(); // unprotecting MQeFields data MQeDESCryptor des2 = new MQeDESCryptor(); MQeAttribute desA2 = new MQeAttribute(null, des2, null); MQeKey localkey2 = new MQeKey(); localkey2.setLocalKey("It_is_a_secret"); desA2.setKey(localkey); MQeFields localf2 = new MQeFields(); localf2.setAttribute(desA2); localf2.restore(temp); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |