All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----sun.security.jsafe.RSACipher
PKCS #1 can encrypt a variable number of bytes, ranging from one to k - 11 (where k is the modulus length in bytes). Padding is specified by the PKCS #1 algorithm, and the encrypted data is the same size as the modulus. With block type 02 (encrypt with public key, as for key exchange) that padding uses random data. In block type 01 (encrypt with the private key, as for digital signing) the padding is fixed data.
NOTE: This currently doesn't depend on features not in JDK 1.1, but the encryption API is modeled on the proposed encryption APIs that are currently unbundled from that release. It deletes most of the API and SPI calls, since they're not currently useful. At this time, it also draws an intialization-time distinction between two block types that those proposed encryption APIs only allow to be made by providing distinct ciphers.
public RSACipher()
public void initialize(Key key, boolean toEncrypt) throws InvalidKeyException
NOTE: Strictly speaking, encrypting with a public key should provide a source of randomness; a default source is used when it's required.
public byte[] padAndEncrypt(byte plaintext[]) throws SecurityException
Following this encryption, this cipher object may be used to perform more such encryptions.
public byte[] decryptAndUnpad(byte ciphertext[]) throws SecurityException
Following this decryption, this cipher object may be used to perform more such decryptions.
public String toString()
protected void finalize()
All Packages Class Hierarchy This Package Previous Next Index