public class RsaClientCipher extends java.lang.Object implements EncryptionCipher
Constructor and Description |
---|
RsaClientCipher(byte[] encodedPublicKey)
Creates a new cipher client using the specified RSA public key.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
encrypt(byte[] data)
Encrypts the specified data.
|
void |
init()
Initializes the cipher instance.
|
public RsaClientCipher(byte[] encodedPublicKey)
encodedPublicKey
- a RSA public key.public void init() throws java.lang.Exception
init
in interface EncryptionCipher
java.lang.Exception
public byte[] encrypt(byte[] data) throws java.security.GeneralSecurityException
encrypt
in interface EncryptionCipher
data
- the data to encrypt.java.security.GeneralSecurityException