Class NativeKeyPairGeneratorSpi


  • public class NativeKeyPairGeneratorSpi
    extends java.lang.Object
    NativeKeyPairGenerator Service Provider Mock
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int nativeGenerateKeyPair​(int algorithmId, int rsaKeySize, int rsaPublicExponent, byte[] ecCurveName)
      Generate the key pair in the specific algorithm represented by algorithmId
      static int nativeGetAlgorithm​(byte[] algorithmBytes)  
      static int nativeGetCloseId​(int algorithmId)
      Gets the id of the native close function.
      • Methods inherited from class java.lang.Object

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

      • NativeKeyPairGeneratorSpi

        public NativeKeyPairGeneratorSpi()
    • Method Detail

      • nativeGetAlgorithm

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

        public static int nativeGenerateKeyPair​(int algorithmId,
                                                int rsaKeySize,
                                                int rsaPublicExponent,
                                                byte[] ecCurveName)
                                         throws java.security.InvalidAlgorithmParameterException
        Generate the key pair in the specific algorithm represented by algorithmId
        Parameters:
        algorithmId - the algorithm id to use for the key generation
        rsaKeySize - the key size to be generated
        rsaPublicExponent - the public exponent for RSA keys
        ecCurveName - in order to generate the corresponding (precomputed) elliptic curve domain parameters. curve name like secp521r1. a byte representation of the name as a NULL terminated String (ends with '\0').
        Throws:
        java.security.InvalidAlgorithmParameterException
        ej.sni.NativeException - on error
      • nativeGetCloseId

        public static int nativeGetCloseId​(int algorithmId)
        Gets the id of the native close function.
        Parameters:
        algorithmId - the algorithm id to use for the key generation
        Returns:
        the id of the static native close function
        Throws:
        ej.sni.NativeException - on error