org.apache.xml.security.algorithms.encryption.helper
Class PKCS15Cipher

java.lang.Object
  |
  +--org.apache.xml.security.algorithms.encryption.helper.PKCS15Cipher

public class PKCS15Cipher
extends java.lang.Object

Author:
$Author: geuerp $
See Also:
org.bouncycastle.crypto.encodings.PKCS1Encoding

Constructor Summary
PKCS15Cipher(javax.crypto.Cipher rsaCipher)
          Constructor PKCS15Cipher
 
Method Summary
 byte[] decodeBlock(byte[] in, int inOff, int inLen)
           
 byte[] encodeBlock(byte[] in, int inOff, int inLen)
          Method encodeBlock
 int getInputBlockSize()
          Method getInputBlockSize
 int getOutputBlockSize()
          Method getOutputBlockSize
 void init(int mode, java.security.Key key, java.security.SecureRandom secureRandom)
          Method init
 byte[] processBlock(byte[] in, int inOff, int inLen)
          Method processBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS15Cipher

public PKCS15Cipher(javax.crypto.Cipher rsaCipher)
Constructor PKCS15Cipher

Parameters:
rsaCipher -
Method Detail

init

public void init(int mode,
                 java.security.Key key,
                 java.security.SecureRandom secureRandom)
          throws java.security.InvalidKeyException
Method init

Parameters:
mode -
key -
secureRandom -
Throws:
java.security.InvalidKeyException

getInputBlockSize

public int getInputBlockSize()
Method getInputBlockSize

Returns:

getOutputBlockSize

public int getOutputBlockSize()
Method getOutputBlockSize

Returns:

processBlock

public byte[] processBlock(byte[] in,
                           int inOff,
                           int inLen)
                    throws InvalidCipherTextException,
                           javax.crypto.IllegalBlockSizeException,
                           javax.crypto.BadPaddingException
Method processBlock

Parameters:
in -
inOff -
inLen -
Returns:
Throws:
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
InvalidCipherTextException

encodeBlock

public byte[] encodeBlock(byte[] in,
                          int inOff,
                          int inLen)
                   throws InvalidCipherTextException,
                          javax.crypto.IllegalBlockSizeException,
                          javax.crypto.BadPaddingException
Method encodeBlock

Parameters:
in -
inOff -
inLen -
Returns:
Throws:
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
InvalidCipherTextException

decodeBlock

public byte[] decodeBlock(byte[] in,
                          int inOff,
                          int inLen)
                   throws InvalidCipherTextException,
                          javax.crypto.IllegalBlockSizeException,
                          javax.crypto.BadPaddingException
Parameters:
in -
inOff -
inLen -
Returns:
Throws:
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
InvalidCipherTextException - if the decrypted block is not in PKCS1 format.