Authentication
API v8.1 SP2

com.rsa.ace.techservice.cipher
Class AgentDesCsmCipher

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

public class AgentDesCsmCipher
extends java.lang.Object
implements AgentCipherProvider


Constructor Summary
AgentDesCsmCipher(byte[] keyData)
           
 
Method Summary
 int decryptPacket(byte[] agentEncryption, int decryptionOffset, byte[] cleartext)
          Decrypts encrypted data starting at the offset provided.
 int encryptPacket(byte[] cleartext, int cleartextLength, int encryptionOffset, byte[] agentEncryption)
          This encrypts the bytes passed starting at the offset provided.
 byte getCipherID()
          This returns the cipher ID of this provider.
 int getMaxEncryptedSize(int inputSize)
          This function provides the maximium amount of expansion encryption adds to a packet.
 void setKey(byte[] keyData)
          Sets the key to the byte array provided.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentDesCsmCipher

public AgentDesCsmCipher(byte[] keyData)
                  throws AgentCipherException
Throws:
AgentCipherException
Method Detail

setKey

public void setKey(byte[] keyData)
            throws AgentCipherException
Description copied from interface: AgentCipherProvider
Sets the key to the byte array provided.

Specified by:
setKey in interface AgentCipherProvider
Parameters:
keyData - The key to be used for encryption & decryption.
Throws:
AgentCipherException - If the key is null or the length is not valid.
See Also:
AgentCipherProvider.setKey(byte[])

decryptPacket

public int decryptPacket(byte[] agentEncryption,
                         int decryptionOffset,
                         byte[] cleartext)
                  throws AgentCipherException
Description copied from interface: AgentCipherProvider
Decrypts encrypted data starting at the offset provided.

Specified by:
decryptPacket in interface AgentCipherProvider
Parameters:
agentEncryption - The data to be decrypted.
decryptionOffset - The offset at which the encrypted data starts.
cleartext - The cleartext buffer filled upon return.
Returns:
The length of the decrypted data.
Throws:
AgentCipherException - If crypto errors occur or parameters are invalid.
See Also:
AgentCipherProvider.decryptPacket(byte[], int, byte[])

encryptPacket

public int encryptPacket(byte[] cleartext,
                         int cleartextLength,
                         int encryptionOffset,
                         byte[] agentEncryption)
                  throws AgentCipherException
Description copied from interface: AgentCipherProvider
This encrypts the bytes passed starting at the offset provided.

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 crypto errors occur or parameters are invalid.
See Also:
AgentCipherProvider.encryptPacket(byte[], int, int, byte[])

getCipherID

public byte getCipherID()
Description copied from interface: AgentCipherProvider
This returns the cipher ID of this provider.

Specified by:
getCipherID in interface AgentCipherProvider
Returns:
The cipher ID.
See Also:
AgentCipherProvider.getCipherID()

getMaxEncryptedSize

public int getMaxEncryptedSize(int inputSize)
Description copied from interface: AgentCipherProvider
This function provides the maximium amount of expansion encryption adds to a packet. Other cipher providers can override this if they add more overhead.

Specified by:
getMaxEncryptedSize in interface AgentCipherProvider
Parameters:
inputSize - The size of the cleartext input.
Returns:
The number of extra bytes required for the given input packet size.
See Also:
AgentCipherProvider.getMaxEncryptedSize(int)

Authentication
API v8.1 SP2

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