- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.crypto.MacDigester
-
- All Implemented Interfaces:
InitializeSupport,Digester
public class MacDigester extends InitializeObject implements Digester
- Author:
- Loc Ha
-
-
Constructor Summary
Constructors Constructor Description MacDigester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacDigestercopy()voiddestroy()byte[]digest(byte[] message)byte[]digest(byte[] message, Out<byte[]> salt)protected voidinit()MacDigestersetAlgorithm(String algorithm)MacDigestersetProvider(String provider)MacDigestersetSecret(byte[] secret)MacDigestersetSecret(String secretOrEnv)booleanverify(byte[] message, byte[] hmac)booleanverify(byte[] message, byte[] hmac, byte[] salt)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, initialize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.appslandia.common.base.InitializeSupport
initialize
-
-
-
-
Method Detail
-
init
protected void init() throws Exception- Specified by:
initin classInitializeObject- Throws:
Exception
-
destroy
public void destroy() throws DestroyException- Specified by:
destroyin interfaceInitializeSupport- Overrides:
destroyin classInitializeObject- Throws:
DestroyException
-
digest
public byte[] digest(byte[] message) throws CryptoException- Specified by:
digestin interfaceDigester- Throws:
CryptoException
-
verify
public boolean verify(byte[] message, byte[] hmac) throws CryptoException- Specified by:
verifyin interfaceDigester- Throws:
CryptoException
-
digest
public byte[] digest(byte[] message, Out<byte[]> salt) throws CryptoException- Specified by:
digestin interfaceDigester- Throws:
CryptoException
-
verify
public boolean verify(byte[] message, byte[] hmac, byte[] salt) throws CryptoException- Specified by:
verifyin interfaceDigester- Throws:
CryptoException
-
setAlgorithm
public MacDigester setAlgorithm(String algorithm)
-
setProvider
public MacDigester setProvider(String provider)
-
setSecret
public MacDigester setSecret(byte[] secret)
-
setSecret
public MacDigester setSecret(String secretOrEnv)
-
copy
public MacDigester copy()
-
-