public class CryptoTool
extends java.lang.Object
| Constructor and Description |
|---|
CryptoTool() |
CryptoTool(java.security.Key secretKey) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decrypt(java.lang.String strToDecrypt)
Decrypts string.
|
java.lang.String |
decryptByPattern(java.lang.String content,
java.util.regex.Pattern pattern)
Decrypts substrings in text using pattern.
|
java.lang.String |
decryptByPatternAndWrap(java.lang.String content,
java.util.regex.Pattern pattern,
java.lang.String wrapper) |
java.lang.String |
encrypt(java.lang.String strToEncrypt)
Encrypts string.
|
java.lang.String |
encryptByPattern(java.lang.String content,
java.util.regex.Pattern pattern)
Encrypts substrings in text using pattern.
|
java.lang.String |
encryptByPatternAndWrap(java.lang.String content,
java.util.regex.Pattern pattern,
java.lang.String wrapper) |
java.lang.String |
getAlgorithm() |
javax.crypto.Cipher |
getCipher() |
void |
setAlgorithm(java.lang.String algorithm) |
void |
setCipher(javax.crypto.Cipher cipher) |
public CryptoTool()
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.io.IOException,
java.net.URISyntaxException
java.security.NoSuchAlgorithmExceptionjavax.crypto.NoSuchPaddingExceptionjava.io.IOExceptionjava.net.URISyntaxExceptionpublic CryptoTool(java.security.Key secretKey)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmExceptionjavax.crypto.NoSuchPaddingExceptionpublic java.lang.String encrypt(java.lang.String strToEncrypt)
strToEncrypt - public java.lang.String decrypt(java.lang.String strToDecrypt)
strToDecrypt - public java.lang.String encryptByPattern(java.lang.String content,
java.util.regex.Pattern pattern)
content - pattern - public java.lang.String decryptByPattern(java.lang.String content,
java.util.regex.Pattern pattern)
content - pattern - public java.lang.String encryptByPatternAndWrap(java.lang.String content,
java.util.regex.Pattern pattern,
java.lang.String wrapper)
public java.lang.String decryptByPatternAndWrap(java.lang.String content,
java.util.regex.Pattern pattern,
java.lang.String wrapper)
public java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String algorithm)
public javax.crypto.Cipher getCipher()
public void setCipher(javax.crypto.Cipher cipher)