Class NativeMessageDigestSpi


  • public class NativeMessageDigestSpi
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void nativeClose​(int nativeAlgorithmId, int nativeId)  
      static void nativeDigest​(int nativeAlgorithmId, int nativeId, byte[] out, int offset, int length)  
      static int nativeGetAlgorithmDescription​(byte[] algorithmBytes, byte[] description)
      Gets for the given algorithm the message digest description.
      static int nativeGetCloseId​(int nativeAlgorithmId)
      Gets the id of the native close function.
      static int nativeInit​(int nativeAlgorithmId)
      Returns a nativeId.
      static void nativeUpdate​(int nativeAlgorithmId, int nativeId, byte[] buffer, int offset, int length)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NativeMessageDigestSpi

        public NativeMessageDigestSpi()
    • Method Detail

      • nativeGetAlgorithmDescription

        public static int nativeGetAlgorithmDescription​(byte[] algorithmBytes,
                                                        byte[] description)
        Gets for the given algorithm the message digest description.

        description must be filled-in with:

        • [0-3]: digestLength: length of the message digest in bytes
        Parameters:
        algorithmBytes - Null terminated string that describes the algorithm
        description - the output buffer to fill in (see above).
        Returns:
        algorithm ID on success or -1 on error.
      • nativeInit

        public static int nativeInit​(int nativeAlgorithmId)
                              throws ej.sni.NativeException
        Returns a nativeId.
        Throws:
        ej.sni.NativeException - on error
      • nativeClose

        public static void nativeClose​(int nativeAlgorithmId,
                                       int nativeId)
                                throws ej.sni.NativeException,
                                       java.lang.IllegalArgumentException,
                                       java.io.IOException
        Parameters:
        nativeAlgorithmId -
        nativeId -
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        ej.sni.NativeException - on error
      • nativeUpdate

        public static void nativeUpdate​(int nativeAlgorithmId,
                                        int nativeId,
                                        byte[] buffer,
                                        int offset,
                                        int length)
                                 throws ej.sni.NativeException
        Parameters:
        nativeAlgorithmId -
        nativeId -
        Throws:
        ej.sni.NativeException - on error
      • nativeDigest

        public static void nativeDigest​(int nativeAlgorithmId,
                                        int nativeId,
                                        byte[] out,
                                        int offset,
                                        int length)
                                 throws ej.sni.NativeException
        Parameters:
        nativeAlgorithmId -
        nativeId -
        Throws:
        ej.sni.NativeException - on error
      • nativeGetCloseId

        public static int nativeGetCloseId​(int nativeAlgorithmId)
                                    throws ej.sni.NativeException
        Gets the id of the native close function.
        Returns:
        the id of the static native close function
        Throws:
        ej.sni.NativeException