Authentication
API v8.1 SP2

com.rsa.ace.techservice.cipher
Class AgentNULLCipher

java.lang.Object
  extended by com.rsa.ace.techservice.cipher.AbstractAgentCipherProvider
      extended by com.rsa.ace.techservice.cipher.AgentNULLCipher
All Implemented Interfaces:
AgentCipherProvider

public class AgentNULLCipher
extends AbstractAgentCipherProvider
implements AgentCipherProvider

The NULL Encryption provider. This performs a "NULL" encryption on the data provided. It is passed a key and has a "setKey()" method to adhere to the AgentCipherProvider interface. Any key(s) supplied are ignored. The NULL encryption and decryption are effectively a data copy with a ciphersuite/length header added. The encrypt/decrypt methods here use the base class methods in the manner intended.


Method Summary
 int decryptPacket(byte[] agentEncryption, int headerOffset, byte[] cleartext)
          NULL decryption.
 int encryptPacket(byte[] cleartext, int cleartextLength, int encryptionOffset, byte[] agentEncryption)
          NULL encryption.
 byte getCipherID()
          This returns the cipher ID of this provider.
 void setKey(byte[] key)
          Sets the NULL encryption key.
 
Methods inherited from class com.rsa.ace.techservice.cipher.AbstractAgentCipherProvider
getMajorVersion, getMaxEncryptedSize, getMinorVersion, setBufferArray, setMajorVersion, setMinorVersion
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rsa.ace.techservice.cipher.AgentCipherProvider
getMaxEncryptedSize
 

Method Detail

setKey

public void setKey(byte[] key)
            throws AgentCipherException
Sets the NULL encryption key. Passed a key (ignored).

Specified by:
setKey in interface AgentCipherProvider
Parameters:
key - The NULL encryption key, Unused.
Throws:
AgentCipherException - If the key is null or the length is not valid.

decryptPacket

public int decryptPacket(byte[] agentEncryption,
                         int headerOffset,
                         byte[] cleartext)
                  throws AgentCipherException
NULL decryption. This "decrypts" data starting at the offset provided.

Specified by:
decryptPacket in interface AgentCipherProvider
Parameters:
agentEncryption - The data to be decrypted.
headerOffset - The offset at which the agent packet (header) starts.
cleartext - The cleartext buffer filled upon return.
Returns:
The length of the decrypted data.
Throws:
AgentCipherException - If the ciphersuite does not match.

encryptPacket

public int encryptPacket(byte[] cleartext,
                         int cleartextLength,
                         int encryptionOffset,
                         byte[] agentEncryption)
                  throws AgentCipherException
NULL encryption. This "encrypts" the bytes passed starting at the offset provided. It places a ciphersuite/length header on the payload and copies it to the destination.

Specified by:
encryptPacket in interface AgentCipherProvider
Parameters:
cleartext - The cleartext buffer to be encrypted.
cleartextLength - The length of the cleartext buffer to be encrypted.
encryptionOffset - The offset at which the data should be encrypted.
agentEncryption - The returned encrypted data.
Returns:
The length of the encrypted result
Throws:
AgentCipherException - If parameters are invalid.

getCipherID

public byte getCipherID()
This returns the cipher ID of this provider.

Specified by:
getCipherID in interface AgentCipherProvider
Returns:
The cipher ID.

Authentication
API v8.1 SP2

Copyright © 1999 - 2011 EMC Corporation. All Rights Reserved.