Package com.wolfssl.wolfcrypt
Class MessageDigest
java.lang.Object
com.wolfssl.wolfcrypt.WolfObject
com.wolfssl.wolfcrypt.NativeStruct
com.wolfssl.wolfcrypt.MessageDigest
public abstract class MessageDigest extends NativeStruct
Common API for Message Digests.
- Version:
- 1.0, March 2017
- Author:
- Moisés Guimarães
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MessageDigest()
-
Method Summary
Modifier and Type Method Description byte[]
digest()
void
digest(byte[] hash)
void
digest(java.nio.ByteBuffer hash)
abstract int
digestSize()
void
init()
protected abstract void
native_final(byte[] hash)
protected abstract void
native_final(java.nio.ByteBuffer hash, int offset)
protected abstract void
native_init()
protected abstract void
native_update(byte[] data, int offset, int length)
protected abstract void
native_update(java.nio.ByteBuffer data, int offset, int length)
void
releaseNativeStruct()
Releases the host data stored in a NativeStruct.void
update(byte[] data)
void
update(byte[] data, int len)
void
update(byte[] data, int offset, int len)
void
update(java.nio.ByteBuffer data)
void
update(java.nio.ByteBuffer data, int length)
Methods inherited from class com.wolfssl.wolfcrypt.NativeStruct
finalize, getNativeStruct, mallocNativeStruct, setNativeStruct
-
Constructor Details
-
MessageDigest
public MessageDigest()
-
-
Method Details
-
native_init
protected abstract void native_init() -
native_update
protected abstract void native_update(java.nio.ByteBuffer data, int offset, int length) -
native_update
protected abstract void native_update(byte[] data, int offset, int length) -
native_final
protected abstract void native_final(java.nio.ByteBuffer hash, int offset) -
native_final
protected abstract void native_final(byte[] hash) -
digestSize
public abstract int digestSize() -
init
public void init() -
update
public void update(java.nio.ByteBuffer data, int length) -
update
public void update(java.nio.ByteBuffer data) -
update
public void update(byte[] data, int offset, int len) -
update
public void update(byte[] data, int len) -
update
public void update(byte[] data) -
digest
public void digest(java.nio.ByteBuffer hash) throws javax.crypto.ShortBufferException- Throws:
javax.crypto.ShortBufferException
-
digest
public void digest(byte[] hash) throws javax.crypto.ShortBufferException- Throws:
javax.crypto.ShortBufferException
-
digest
public byte[] digest() -
releaseNativeStruct
public void releaseNativeStruct()Description copied from class:NativeStruct
Releases the host data stored in a NativeStruct. This method provides a way to release host data without depending on the garbage collector to get around to releasing it. Derived objects whose native data structures have their own free functions, should be override this method to call that function.- Overrides:
releaseNativeStruct
in classNativeStruct
-