public class CryptoEnvironment extends Object
| Modifier and Type | Method and Description |
|---|---|
ICryptdec |
createCryptdec(String id)
Create an
ICryptdec for id. |
byte[] |
decryptBytes(byte[] bytes)
Decrypt a plain byte array which was previously encrypted using
encryptBytes. |
byte[] |
decryptBytes(byte[] bytes,
ICryptdec cryptdec)
Decrypt a plain byte array which was previously encrypted using
encryptBytes using cryptdec. |
byte[] |
decryptBytesEncoded(String value)
Decrypt the encoded, encrypted value created using "encryptBytesEncoded"
using the default
ICryptdec. |
byte[] |
decryptBytesEncoded(String value,
ICryptdec cryptdec)
Decrypt the encoded, encrypted value created using "encryptBytesEncoded"
with cryptdec.
|
String |
decryptString(String value)
Decrypt a string which was previously encrypted using
encryptString, using the default ICryptdec. |
String |
decryptString(String value,
ICryptdec cryptdec)
Decrypt a string which was previously encrypted using
encryptString, using cryptdec. |
String |
decryptStringEncoded(String value)
Decrypt the encoded, encrypted value created using "encryptStringEncoded"
using the default
ICryptdec. |
String |
decryptStringEncoded(String value,
ICryptdec cryptdec)
Decrypt the encoded, encrypted value created using "encryptStringEncoded"
with cryptdec.
|
byte[] |
encryptBytes(byte[] bytes)
Encrypt a byte array using the default
ICryptdec. |
byte[] |
encryptBytes(byte[] bytes,
ICryptdec cryptdec)
Encrypt a byte array using the cryptdec.
|
String |
encryptBytesEncoded(byte[] value)
Encrypt the byte array value using the default
ICryptdec. |
String |
encryptBytesEncoded(byte[] bytes,
ICryptdec cryptdec)
Encrypt a byte array using the cryptdec.
|
String |
encryptCharsEncoded(char[] value)
Encrypt the char array value using the default
ICryptdec. |
String |
encryptCharsEncoded(char[] value,
ICryptdec cryptdec)
Encrypt the char array value using the cryptdec.
|
String |
encryptString(String value)
Encrypt a String using the default
ICryptdec. |
String |
encryptString(String value,
ICryptdec cryptdec)
Encrypt a String using cryptdec.
|
String |
encryptStringEncoded(String value)
Encrypt the String value using the default
ICryptdec. |
String |
encryptStringEncoded(String value,
ICryptdec cryptdec)
Encrypt the String value using the cryptdec.
|
static CryptoEnvironment |
get() |
ICryptdecFactory |
getDefaultCryptdecFactoryDecrypt() |
ICryptdecFactory |
getDefaultCryptdecFactoryEncrypt() |
void |
registerCryptdecFactory(ICryptdecFactory factory) |
void |
setDefaultCryptdecFactoryDecrypt(ICryptdecFactory factory) |
void |
setDefaultCryptdecFactoryEncrypt(ICryptdecFactory factory) |
public static CryptoEnvironment get()
public ICryptdec createCryptdec(String id) throws IOException
ICryptdec for id.id - IOExceptionpublic byte[] decryptBytes(byte[] bytes)
throws IOException
encryptBytes. For decryption the default ICryptdec
is used.bytes - bytesIOExceptionpublic byte[] decryptBytes(byte[] bytes,
ICryptdec cryptdec)
throws IOException
encryptBytes using cryptdec.bytes - bytesIOExceptionpublic byte[] decryptBytesEncoded(String value) throws IOException
ICryptdec.value - IOExceptionpublic byte[] decryptBytesEncoded(String value, ICryptdec cryptdec) throws IOException
value - cryptdec - IOExceptionpublic String decryptString(String value) throws IOException
encryptString, using the default ICryptdec.value - valueIOExceptionpublic String decryptString(String value, ICryptdec cryptdec) throws IOException
encryptString, using cryptdec.value - valueIOExceptionpublic String decryptStringEncoded(String value) throws IOException
ICryptdec. The decrypted data is converted to a
String using the UTF-8 encoding.value - IOExceptionpublic String decryptStringEncoded(String value, ICryptdec cryptdec) throws IOException
value - cryptdec - IOExceptionpublic byte[] encryptBytes(byte[] bytes)
throws IOException
ICryptdec.
The result is the encrypted byte array.bytes - bytesIOExceptionpublic byte[] encryptBytes(byte[] bytes,
ICryptdec cryptdec)
throws IOException
bytes - bytesIOExceptionpublic String encryptBytesEncoded(byte[] value) throws IOException
ICryptdec.
The result is an encoded representation (cryptdec id + "#" +
base64(encryption)) of the encrypted data.value - IOExceptionpublic String encryptBytesEncoded(byte[] bytes, ICryptdec cryptdec) throws IOException
bytes - cryptdec - IOExceptionpublic String encryptCharsEncoded(char[] value) throws IOException
ICryptdec. The
char array is converted to a byte array using the UTF-8 encoding.
The result is an encoded representation (cryptdec id + "#" +
base64(encryption)) of the encrypted data.value - IOExceptionpublic String encryptCharsEncoded(char[] value, ICryptdec cryptdec) throws IOException
value - IOExceptionpublic String encryptString(String value) throws IOException
ICryptdec. The result is a
Base64 encoded version of the encrypted UTF-8 encoded input bytes.value - valueIOExceptionpublic String encryptString(String value, ICryptdec cryptdec) throws IOException
value - valueIOExceptionpublic String encryptStringEncoded(String value) throws IOException
ICryptdec. The value
converted to a byte array using the UTF-8 encoding.
The result is an encoded representation (cryptdec id + "#" +
base64(encryption)) of the encrypted data.value - IOExceptionpublic String encryptStringEncoded(String value, ICryptdec cryptdec) throws IOException
value - IOExceptionpublic ICryptdecFactory getDefaultCryptdecFactoryDecrypt()
public ICryptdecFactory getDefaultCryptdecFactoryEncrypt()
public void registerCryptdecFactory(ICryptdecFactory factory)
public void setDefaultCryptdecFactoryDecrypt(ICryptdecFactory factory)
public void setDefaultCryptdecFactoryEncrypt(ICryptdecFactory factory)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.