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()voiddigest(byte[] hash)voiddigest(java.nio.ByteBuffer hash)abstract intdigestSize()voidinit()protected abstract voidnative_final(byte[] hash)protected abstract voidnative_final(java.nio.ByteBuffer hash, int offset)protected abstract voidnative_init()protected abstract voidnative_update(byte[] data, int offset, int length)protected abstract voidnative_update(java.nio.ByteBuffer data, int offset, int length)voidreleaseNativeStruct()Releases the host data stored in a NativeStruct.voidupdate(byte[] data)voidupdate(byte[] data, int len)voidupdate(byte[] data, int offset, int len)voidupdate(java.nio.ByteBuffer data)voidupdate(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:NativeStructReleases 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:
releaseNativeStructin classNativeStruct
-