Class NativeKeyPairGeneratorSpi
- java.lang.Object
-
- com.microej.crypto.internal.keypairgen.NativeKeyPairGeneratorSpi
-
public class NativeKeyPairGeneratorSpi extends java.lang.ObjectNativeKeyPairGenerator Service Provider Mock
-
-
Constructor Summary
Constructors Constructor Description NativeKeyPairGeneratorSpi()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intnativeGenerateKeyPair(int algorithmId, int rsaKeySize, int rsaPublicExponent, byte[] ecCurveName)Generate the key pair in the specific algorithm represented by algorithmIdstatic intnativeGetAlgorithm(byte[] algorithmBytes)static intnativeGetCloseId(int algorithmId)Gets the id of the native close function.
-
-
-
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.InvalidAlgorithmParameterExceptionGenerate the key pair in the specific algorithm represented by algorithmId- Parameters:
algorithmId- the algorithm id to use for the key generationrsaKeySize- the key size to be generatedrsaPublicExponent- the public exponent for RSA keysecCurveName- 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.InvalidAlgorithmParameterExceptionej.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
-
-