Package org.nuxeo.common.codec
Class Crypto.NoOp
- java.lang.Object
-
- org.nuxeo.common.codec.Crypto
-
- org.nuxeo.common.codec.Crypto.NoOp
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.common.codec.Crypto
Crypto.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description static Crypto
NO_OP
-
Fields inherited from class org.nuxeo.common.codec.Crypto
AES, AES_ECB_PKCS5PADDING, CRYPTO_PATTERN, DEFAULT_ALGO, DES, DES_ECB_PKCS5PADDING, IMPLEMENTED_ALGOS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear sensible values.byte[]
decrypt(String strToDecrypt)
The method returns either the decryptedstrToDecrypt
, either thestrToDecrypt
itself if it is not recognized as a crypted string or if the decryption fails.String
encrypt(String algorithm, byte[] bytesToEncrypt)
-
Methods inherited from class org.nuxeo.common.codec.Crypto
encrypt, getBytes, getChars, getKeysFromKeyStore, getSecretKey, getSHA1Digest, getSHA1DigestOrEmpty, isEncrypted, setKeyInKeyStore, verifyKey, verifyKey
-
-
-
-
Field Detail
-
NO_OP
public static final Crypto NO_OP
-
-
Method Detail
-
encrypt
public String encrypt(String algorithm, byte[] bytesToEncrypt)
- Overrides:
encrypt
in classCrypto
- Parameters:
algorithm
- cipher transformation of the form "algorithm/mode/padding" or "algorithm". See the Cipher section in the Java Cryptography Architecture Standard Algorithm Name Documentation.
-
decrypt
public byte[] decrypt(String strToDecrypt)
Description copied from class:Crypto
The method returns either the decryptedstrToDecrypt
, either thestrToDecrypt
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 ofchar[]
is recommended).- Overrides:
decrypt
in classCrypto
- Returns:
- the decrypted
strToDecrypt
as an array of bytes, nevernull
- See Also:
Crypto.getChars(byte[])
-
-