Class NativeMacSpi


  • public class NativeMacSpi
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      NativeMacSpi()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void nativeClose​(int nativeAlgorithmId, int nativeId)  
      static void nativeDoFinal​(int AlgorithmId, int id, 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 AlgorithmId, byte[] secretKey, int secretKeyLength)
      Throw Exception on error.
      static void nativeReset​(int AlgorithmId, int id)  
      static void nativeUpdate​(int AlgorithmId, int id, 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

      • NativeMacSpi

        public NativeMacSpi()
    • 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]: macLength: 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 AlgorithmId,
                                     byte[] secretKey,
                                     int secretKeyLength)
                              throws java.lang.Exception
        Throw Exception on error. Returns a Id.
        Throws:
        java.lang.Exception
      • nativeUpdate

        public static void nativeUpdate​(int AlgorithmId,
                                        int id,
                                        byte[] buffer,
                                        int offset,
                                        int length)
                                 throws java.lang.Exception
        Parameters:
        AlgorithmId - the algorithm id
        id - the native resource id
        Throws:
        java.lang.Exception - on error
      • nativeDoFinal

        public static void nativeDoFinal​(int AlgorithmId,
                                         int id,
                                         byte[] out,
                                         int offset,
                                         int length)
                                  throws java.lang.Exception
        Parameters:
        AlgorithmId - the algorithm id
        id - the native resource id
        Throws:
        java.lang.Exception - on error
      • nativeReset

        public static void nativeReset​(int AlgorithmId,
                                       int id)
                                throws java.lang.Exception
        Parameters:
        AlgorithmId - the algorithm id
        id - the native resource id
        Throws:
        java.lang.Exception - on error
      • nativeClose

        public static void nativeClose​(int nativeAlgorithmId,
                                       int nativeId)
                                throws ej.sni.NativeException,
                                       java.lang.IllegalArgumentException
        Parameters:
        nativeAlgorithmId - the algorithm id
        nativeId - the native resource id
        Throws:
        ej.sni.NativeException - on error
        java.lang.IllegalArgumentException - if nativeId does not match a registered native resource
      • nativeGetCloseId

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