Package com.microej.crypto.internal.mac
Class NativeMacSpi
- java.lang.Object
-
- com.microej.crypto.internal.mac.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 voidnativeClose(int nativeAlgorithmId, int nativeId)static voidnativeDoFinal(int AlgorithmId, int id, byte[] out, int offset, int length)static intnativeGetAlgorithmDescription(byte[] algorithmBytes, byte[] description)Gets for the given algorithm the message digest description.static intnativeGetCloseId(int nativeAlgorithmId)Gets the id of the native close function.static intnativeInit(int AlgorithmId, byte[] secretKey, int secretKeyLength)Throw Exception on error.static voidnativeReset(int AlgorithmId, int id)static voidnativeUpdate(int AlgorithmId, int id, byte[] buffer, int offset, int length)
-
-
-
Method Detail
-
nativeGetAlgorithmDescription
public static int nativeGetAlgorithmDescription(byte[] algorithmBytes, byte[] description)Gets for the given algorithm the message digest description.descriptionmust be filled-in with:- [0-3]: macLength: length of the message digest in bytes
- Parameters:
algorithmBytes- Null terminated string that describes the algorithmdescription- 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.ExceptionThrow 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 idid- 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 idid- 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 idid- 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 idnativeId- the native resource id- Throws:
ej.sni.NativeException- on errorjava.lang.IllegalArgumentException- ifnativeIddoes not match a registered native resource
-
nativeGetCloseId
public static int nativeGetCloseId(int nativeAlgorithmId) throws ej.sni.NativeExceptionGets 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
-
-