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

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

public class OAEPCipher
extends java.lang.Object

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

Constructor Summary
OAEPCipher(javax.crypto.Cipher cipher, java.security.MessageDigest digest, byte[] encodingParams)
          Constructor OAEPCipher
 
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
static void main(java.lang.String[] args)
          Method main
 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

OAEPCipher

public OAEPCipher(javax.crypto.Cipher cipher,
                  java.security.MessageDigest digest,
                  byte[] encodingParams)
Constructor OAEPCipher

Parameters:
cipher -
digest -
encodingParams -
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 decryypted block turns out to be badly formatted.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Method main

Parameters:
args -
Throws:
java.lang.Exception