public abstract class AbstractCrypt extends Object implements ICrypt
Constructor and Description |
---|
AbstractCrypt()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract byte[] |
crypt(byte[] input,
int mode)
Crypts the given byte array
|
String |
decryptUrlSafe(String text)
Decrypts a string into a string.
|
String |
encryptUrlSafe(String plainText)
Encrypt a string into a string using URL safe Base64 encoding.
|
String |
getKey()
Get encryption private key
|
void |
setKey(String key)
Set encryption private key
|
public final String decryptUrlSafe(String text)
decryptUrlSafe
in interface ICrypt
text
- text to decryptpublic final String encryptUrlSafe(String plainText)
encryptUrlSafe
in interface ICrypt
plainText
- text to encryptpublic String getKey()
public void setKey(String key)
protected abstract byte[] crypt(byte[] input, int mode) throws GeneralSecurityException
input
- byte array to be cryptedmode
- crypt modeGeneralSecurityException
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.