public class HexableDecryptor extends AbstractStringDecryptor
HexableDecryptor is the pendant class of HexableEncryptor and decrypts
given String objects that was encrypted with HexableEncryptor. For an example see the
unit test.model| Constructor and Description |
|---|
HexableDecryptor(String privateKey)
Instantiates a new
HexableDecryptor from the given parameters. |
HexableDecryptor(String privateKey,
de.alpharogroup.crypto.algorithm.Algorithm algorithm)
Instantiates a new
HexableDecryptor from the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
String |
decrypt(String encypted) |
protected String |
newAlgorithm()
Factory method for creating a new algorithm that will be used with the cipher object.
|
protected Cipher |
newCipher(String privateKey,
String algorithm,
byte[] salt,
int iterationCount,
int operationMode)
Factory method for creating a new
Cipher from the given parameters. |
newCipher, newKeySpecnewOperationModenewAlgorithmParameterSpec, newCipher, newIterationCount, newSalt, newSecretKeyFactory, onInitializepublic HexableDecryptor(String privateKey) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
HexableDecryptor from the given parameters.privateKey - The private key.InvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.NoSuchPaddingException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeyException - is thrown if initialization of the cypher object fails.UnsupportedEncodingException - is thrown if the named charset is not supported.public HexableDecryptor(String privateKey, de.alpharogroup.crypto.algorithm.Algorithm algorithm) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
HexableDecryptor from the given parameters.privateKey - The private key.algorithm - the algorithmInvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.NoSuchPaddingException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeyException - is thrown if initialization of the cypher object fails.UnsupportedEncodingException - is thrown if the named charset is not supported.protected String newAlgorithm()
newAlgorithm in class AbstractCryptor<Cipher,String>protected Cipher newCipher(String privateKey, String algorithm, byte[] salt, int iterationCount, int operationMode) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedEncodingException
Cipher from the given parameters. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new Cipher from the given parameters.newCipher in class AbstractStringDecryptorprivateKey - the private keyalgorithm - the algorithmsalt - the salt.iterationCount - the iteration countoperationMode - the operation mode for the new cipher objectNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchPaddingException - is thrown if instantiation of the cypher object fails.InvalidKeyException - is thrown if initialization of the cypher object fails.InvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.UnsupportedEncodingException - is thrown if the named charset is not supported.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.