|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.crypto.SymmetricCipherUtils
SymmetricCipherUtils provides a number of useful methods for
encrypting and decrypting various values using a SymmetricCipher.
| Constructor Summary | |
SymmetricCipherUtils()
|
|
| Method Summary | |
static String |
base64DecodeAndDecryptString(SymmetricCipher symCipher,
String input)
Base64 decode, then decrypt and return a String. |
static String |
encryptAndBase64Encode(SymmetricCipher symCipher,
byte[] input)
Encrypt and Base64 encode an array of bytes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SymmetricCipherUtils()
| Method Detail |
public static final String encryptAndBase64Encode(SymmetricCipher symCipher,
byte[] input)
throws IllegalStateException,
IllegalBlockSizeException,
BadPaddingException
The bytes in the input buffer are encrypted using the specified SymmetricCipher then returned as a Base64-encoded String.
symCipher - the SymmetricCipher to be used to encrypt the data.input - the input byte buffer
IllegalStateException - if this cipher is in a wrong state
(e.g., has not been initialized)
IllegalBlockSizeException - - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
BadPaddingException - if the internal encryption cipher has
and invalid padding configuration or has an error while padding data.
public static final String base64DecodeAndDecryptString(SymmetricCipher symCipher,
String input)
throws IllegalStateException,
IllegalBlockSizeException,
BadPaddingException
The Base64-encoded String value is decoded, then decrypted and returned as a String value.
symCipher - the SymmetricCipher to be used to decrypt the data.input - the Base64-encoded input String.
IllegalStateException - if this cipher is in a wrong state
(e.g., has not been initialized)
IllegalBlockSizeException - - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
BadPaddingException - if the internal encryption cipher has
and invalid padding configuration or has an error while padding data.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||