Class NativeKeyFactorySpi


  • public class NativeKeyFactorySpi
    extends java.lang.Object
    Mock implementation for LLAPI: LLSEC_KEY_FACTORY
    • Constructor Detail

      • NativeKeyFactorySpi

        public NativeKeyFactorySpi()
    • Method Detail

      • nativeGetAlgorithmDescription

        public static int nativeGetAlgorithmDescription​(byte[] algorithmBytes)
        Parameters:
        algorithmBytes - Null terminated string that describes the algorithm
        Returns:
        algorithm ID on success or -1 on error.
      • nativeGetPrivateKeyData

        public static int nativeGetPrivateKeyData​(int nativeAlgorithmId,
                                                  byte[] formatBytes,
                                                  byte[] encodedKey,
                                                  int encodedKeyLength)
        Parameters:
        nativeAlgorithmId - the algorithm ID
        formatBytes - the format of the encoded key
        encodedKey - the encoded private key
        encodedKeyLength - the length of the encoded key
        Returns:
        the registered native resource id, or -1 on error.
      • nativeGetPublicKeyData

        public static int nativeGetPublicKeyData​(int nativeAlgId,
                                                 byte[] formatBytes,
                                                 byte[] encodedKey,
                                                 int encodedKeyLength)
      • nativeGetPublicKeyCloseId

        public static int nativeGetPublicKeyCloseId​(int nativeAlgorithmId)
        Gets the id of the native close function.
        Parameters:
        nativeAlgorithmId - the algorithm ID
        Returns:
        the id of the static native close function
        Throws:
        ej.sni.NativeException - on error
      • nativeGetPrivateKeyCloseId

        public static int nativeGetPrivateKeyCloseId​(int nativeAlgorithmId)
        Gets the id of the native close function.
        Parameters:
        nativeAlgorithmId - the algorithm ID
        Returns:
        the id of the static native close function
        Throws:
        ej.sni.NativeException - on error
      • ecPublicKeyFromRaw

        public static int ecPublicKeyFromRaw​(byte[] curveName,
                                             byte[] x,
                                             byte[] y)