|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.crypto.AbstractCipher lumis.portal.crypto.MessageDigestCipher
public class MessageDigestCipher
Uses a MessageDigest algorithm to encrypt data.
In this cipher's configuration, the value of algorithm
element
is used to specify the MessageDigest algorithm; and the provider
element may optionally be used to specify the MessageDigest provider.
MessageDigest
Constructor Summary | |
---|---|
MessageDigestCipher()
|
Method Summary | |
---|---|
protected MessageDigest |
createMessageDigest()
Returns a new MessageDigest instance based on this cipher's
getAlgorithm() and getProvider() . |
byte[] |
decrypt(byte[] value)
Decrypts an array of bytes. |
byte[] |
encrypt(byte[] value)
Encrypts an array of bytes. |
protected String |
getAlgorithm()
Returns the message digest algorithm to be used. |
protected String |
getProvider()
Returns the message digest provider to be used. |
protected boolean |
getUseURLSafeBase64Variant()
Indicates if a URL safe Base64 variant is to be used when encoding bytes to String. |
void |
init(Node configuration)
This method is called only once and before any other method are called. |
protected void |
setAlgorithm(String algorithm)
Sets the message digest algorithm to be used. |
protected void |
setProvider(String provider)
Sets the message digest provider to be used. |
Methods inherited from class lumis.portal.crypto.AbstractCipher |
---|
decrypt, encrypt, getStringCharset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageDigestCipher()
Method Detail |
---|
protected boolean getUseURLSafeBase64Variant()
AbstractCipher
The default value is true. This method may be overridden to change it.
getUseURLSafeBase64Variant
in class AbstractCipher
protected String getAlgorithm()
protected void setAlgorithm(String algorithm)
algorithm
- the algorithm.protected String getProvider()
null
if the default provider
search is to be used.protected void setProvider(String provider)
provider
- the provider, or null
if the default provider
search is to be used.public void init(Node configuration) throws PortalException
ICipherSpi
PortalException
protected MessageDigest createMessageDigest()
MessageDigest
instance based on this cipher's
getAlgorithm()
and getProvider()
.
MessageDigest.getInstance(String, String)
public byte[] encrypt(byte[] value)
ICipher
value
- the original value.
public byte[] decrypt(byte[] value)
ICipher
value
- the encrypted value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |