public static final class Crypto.NoOp extends Crypto
Crypto.NoOp
Modifier and Type | Field and Description |
---|---|
static Crypto |
NO_OP |
AES, AES_ECB_PKCS5PADDING, CRYPTO_PATTERN, DEFAULT_ALGO, DES, DES_ECB_PKCS5PADDING, IMPLEMENTED_ALGOS
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear sensible values.
|
byte[] |
decrypt(String strToDecrypt)
The method returns either the decrypted
strToDecrypt , either the strToDecrypt itself if it is not
recognized as a crypted string or if the decryption fails. |
String |
encrypt(String algorithm,
byte[] bytesToEncrypt) |
encrypt, getBytes, getChars, getKeysFromKeyStore, getSecretKey, getSHA1Digest, getSHA1DigestOrEmpty, isEncrypted, setKeyInKeyStore, verifyKey, verifyKey
public String encrypt(String algorithm, byte[] bytesToEncrypt) throws GeneralSecurityException
encrypt
in class Crypto
algorithm
- cipher transformation of the form "algorithm/mode/padding" or "algorithm". See the Cipher
section in the Java
Cryptography Architecture Standard Algorithm Name Documentation.NoSuchPaddingException
- if algorithm
contains a padding scheme that is not available.NoSuchAlgorithmException
- if algorithm
is in an invalid or not supported format.GeneralSecurityException
public byte[] decrypt(String strToDecrypt)
Crypto
strToDecrypt
, either the strToDecrypt
itself if it is not
recognized as a crypted string or if the decryption fails. The return value is a byte array for security purpose,
it is your responsibility to convert it then to a String or not (use of char[]
is recommended).decrypt
in class Crypto
strToDecrypt
as an array of bytes, never null
Crypto.getChars(byte[])
Copyright © 2018 Nuxeo. All rights reserved.