Class MessageDigest

java.lang.Object
Direct Known Subclasses:
Md5, Sha, Sha256, Sha384, Sha512

public abstract class MessageDigest
extends NativeStruct
Common API for Message Digests.
Version:
1.0, March 2017
Author:
Moisés Guimarães
  • Field Summary

    Fields inherited from class com.wolfssl.wolfcrypt.NativeStruct

    NULL
  • 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

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 class NativeStruct