demo.pkcs
Class RSACipherProviderOAEP

java.lang.Object
  |
  +--iaik.pkcs.pkcs7.RSACipherProvider
        |
        +--demo.pkcs.RSACipherProviderOAEP

public class RSACipherProviderOAEP
extends RSACipherProvider

A RSA cipher provider that uses OEAP padding.

Version:
File Revision 7

Fields inherited from class iaik.pkcs.pkcs7.RSACipherProvider
cipherDecryptProvider_, cipherEncryptProvider_, DECRYPT_MODE, ENCRYPT_MODE
 
Constructor Summary
RSACipherProviderOAEP()
          Default constructor.
RSACipherProviderOAEP(String cipherEncryptProvider, String cipherDecryptProvider)
          Creates a new RSACipherProvider for the given RSA cipher en/decryption providers.
 
Method Summary
protected  byte[] cipher(int mode, Key key, byte[] data)
          En/deciphers the given data using RSA with OAEP padding.
 
Methods inherited from class iaik.pkcs.pkcs7.RSACipherProvider
setCipherProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSACipherProviderOAEP

public RSACipherProviderOAEP()
Default constructor.

RSACipherProviderOAEP

public RSACipherProviderOAEP(String cipherEncryptProvider,
                             String cipherDecryptProvider)
Creates a new RSACipherProvider for the given RSA cipher en/decryption providers.
Parameters:
cipherEncryptProvider - the name of the crypto provider to be used for RSA encryption
cipherDecryptProvider - the name of the crypto provider to be used for RSA encryption
Method Detail

cipher

protected byte[] cipher(int mode,
                        Key key,
                        byte[] data)
                 throws NoSuchProviderException,
                        NoSuchAlgorithmException,
                        InvalidKeyException,
                        GeneralSecurityException
En/deciphers the given data using RSA with OAEP padding.
Overrides:
cipher in class RSACipherProvider
Parameters:
mode - the cipher mode, either ENCRYPT (1) or DECRYPT (2)
key - the key to be used
data - the data to be en/deciphered:
  • for RecipientInfo cek encryption: the raw content encryption key
  • for RecipientInfo cek decryption: the encrypted content encryption key
Returns:
the en/deciphered data:
  • for RecipientInfo cek encryption: the encrypted content encryption key
  • for RecipientInfo cek decryption: the raw (decrypted) content encryption key
Throws:
NoSuchProviderException - if any of the crypto providers of this RSACipherProvider is not suitable for requested operation
NoSuchAlgorithmException - if RSA ciphering is not supported
InvalidKeyException - if the supplied key is invalid
GeneralSecurityException - if a general security problem occurs

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK