public class JCECipher extends ProprietaryOrJCECipher
Constructor and Description |
---|
JCECipher(javax.crypto.Cipher cipher) |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] inputBytes)
decrypts the given byte stream
|
byte[] |
encrypt(byte[] bytes)
Encrypts the given byte stream
|
void |
generatePrivateAndPublicKey(ProprietaryOrJCECipherCallbackObject callbackObject)
Generates or obtains all the private stuff that the encryption protocol needs to do encryption/decryption.
|
java.lang.String |
getAlgorithm()
Gets The algorithm name
|
byte[] |
getPublishInfo()
Gets a byte array containing all the specific info needed to set up en-/decryption.
|
void |
setPublishedInfo(byte[] cipherInfo)
Sets all the specific info needed to set up en-/decryption.
|
public java.lang.String getAlgorithm()
ProprietaryOrJCECipher
getAlgorithm
in class ProprietaryOrJCECipher
public byte[] encrypt(byte[] bytes) throws java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, javax.crypto.BadPaddingException
ProprietaryOrJCECipher
encrypt
in class ProprietaryOrJCECipher
bytes
- the sequence of input bytes to be encryptedjava.security.InvalidKeyException
- -javax.crypto.IllegalBlockSizeException
- -javax.crypto.BadPaddingException
- -public byte[] decrypt(byte[] inputBytes) throws java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, javax.crypto.BadPaddingException
ProprietaryOrJCECipher
decrypt
in class ProprietaryOrJCECipher
inputBytes
- the sequence of bytes to be decryptedjava.security.InvalidKeyException
- -javax.crypto.IllegalBlockSizeException
- -javax.crypto.BadPaddingException
- -public void generatePrivateAndPublicKey(ProprietaryOrJCECipherCallbackObject callbackObject)
ProprietaryOrJCECipher
generatePrivateAndPublicKey
in class ProprietaryOrJCECipher
callbackObject
- the callback Object (e.g. containing the server's Connection handler) that is available for directing callback methods to.public byte[] getPublishInfo()
ProprietaryOrJCECipher
getPublishInfo
in class ProprietaryOrJCECipher
public void setPublishedInfo(byte[] cipherInfo)
ProprietaryOrJCECipher
setPublishedInfo
in class ProprietaryOrJCECipher
cipherInfo
- The byte array containing all the needed info to set up the Cipher