public abstract class AbstractEncryptService extends Object implements EncryptService, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
AbstractEncryptService() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
byte[] |
decrypt(byte[] bytes) |
String |
decrypt(String str) |
byte[] |
encrypt(byte[] bytes) |
String |
encrypt(String str) |
String |
getDecryptKey() |
String |
getEncryptKey() |
String |
getKey() |
protected abstract Cipher |
initDecryptCipher(byte[] key) |
protected abstract Cipher |
initEncryptCipher(byte[] key) |
void |
setDecryptKey(String decryptKey) |
void |
setEncryptKey(String encryptKey) |
void |
setKey(String key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMethodpublic String getKey()
public void setKey(String key)
public String getEncryptKey()
public void setEncryptKey(String encryptKey)
public String getDecryptKey()
public void setDecryptKey(String decryptKey)
public String encrypt(String str)
encrypt in interface EncryptServicepublic String decrypt(String str)
decrypt in interface EncryptServicepublic byte[] encrypt(byte[] bytes)
encrypt in interface EncryptServicepublic byte[] decrypt(byte[] bytes)
decrypt in interface EncryptServicepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected abstract Cipher initEncryptCipher(byte[] key) throws GeneralSecurityException
GeneralSecurityExceptionprotected abstract Cipher initDecryptCipher(byte[] key) throws GeneralSecurityException
GeneralSecurityExceptionCopyright © 2015–2020 cn.gtmap. All rights reserved.