memetic.crypto
Class RTPCrypt

java.lang.Object
  extended by memetic.crypto.RTPCrypt

public class RTPCrypt
extends java.lang.Object

Performs RTP Encryption using a given encryption standard

Version:
1-1-alpha3
Author:
Andrew G D Rowley

Constructor Summary
RTPCrypt(Crypt crypter)
          Creates a new RTPCrypt
 
Method Summary
 int decryptCtrl(byte[] input, int offset, int length, byte[] output, int outOffset)
          Decrypts the given RTCP data
 int decryptData(byte[] input, int offset, int length, byte[] output, int outOffset)
          Decrypts the given RTP data
 int encryptCtrl(byte[] input, int offset, int length, byte[] output, int outOffset)
          Encrypts the given RTCP data
 int encryptData(byte[] input, int offset, int length, byte[] output, int outOffset)
          Encrypts the given RTP data
 int getBlockSize()
           
 int getDecryptOutputSize(int inputSize)
           
 int getEncryptOutputSize(int inputSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPCrypt

public RTPCrypt(Crypt crypter)
Creates a new RTPCrypt

Parameters:
crypter - The encryption standard to use
Method Detail

encryptCtrl

public int encryptCtrl(byte[] input,
                       int offset,
                       int length,
                       byte[] output,
                       int outOffset)
                throws java.security.InvalidKeyException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException,
                       java.security.InvalidAlgorithmParameterException
Encrypts the given RTCP data

Parameters:
input -
offset -
length -
output -
outOffset -
Returns:
The length of the output stored in the output buffer
Throws:
java.security.InvalidAlgorithmParameterException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidKeyException

encryptData

public int encryptData(byte[] input,
                       int offset,
                       int length,
                       byte[] output,
                       int outOffset)
                throws java.security.InvalidKeyException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException,
                       java.security.InvalidAlgorithmParameterException
Encrypts the given RTP data

Parameters:
input -
offset -
length -
output -
outOffset -
Returns:
The length of the output stored in the output buffer
Throws:
java.security.InvalidAlgorithmParameterException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidKeyException

decryptCtrl

public int decryptCtrl(byte[] input,
                       int offset,
                       int length,
                       byte[] output,
                       int outOffset)
                throws java.security.InvalidKeyException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException,
                       java.security.InvalidAlgorithmParameterException
Decrypts the given RTCP data

Parameters:
input -
offset -
length -
output -
outOffset -
Returns:
The length of the output stored in the output buffer
Throws:
java.security.InvalidAlgorithmParameterException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidKeyException

decryptData

public int decryptData(byte[] input,
                       int offset,
                       int length,
                       byte[] output,
                       int outOffset)
                throws java.security.InvalidKeyException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException,
                       java.security.InvalidAlgorithmParameterException
Decrypts the given RTP data

Parameters:
input -
offset -
length -
output -
outOffset -
Returns:
The length of the output stored in the output buffer
Throws:
java.security.InvalidAlgorithmParameterException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException
java.security.InvalidKeyException

getEncryptOutputSize

public int getEncryptOutputSize(int inputSize)
See Also:
Crypt.getEncryptOutputSize(int)

getDecryptOutputSize

public int getDecryptOutputSize(int inputSize)
See Also:
Crypt.getDecryptOutputSize(int)

getBlockSize

public int getBlockSize()
See Also:
Crypt.getBlockSize()