--- old/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java 2018-06-04 19:27:29.222741506 -0300 +++ new/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java 2018-06-04 19:27:29.063740375 -0300 @@ -1291,6 +1291,38 @@ ******************************************************************************/ /** + * getNativeKeyInfo gets the key object attributes and values as an opaque + * byte array to be used in createNativeKey method. + * (Key management) + * + * @param hSession the session's handle + * @param hKey key's handle + * @param hWrappingKey wrapping key's handle to extract sensible keys. -1 if not used. + * @return an opaque byte array containing the key object attributes and values + * @exception PKCS11Exception If an internal PKCS#11 function returns other + * value than CKR_OK. + * @preconditions + * @postconditions + */ + public native byte[] getNativeKeyInfo(long hSession, long hKey, long hWrappingKey) throws PKCS11Exception; + + /** + * createNativeKey creates a key object with attributes and values specified + * by parameter as an opaque byte array. + * (Key management) + * + * @param hSession the session's handle + * @param keyInfo opaque byte array containing key object attributes and values + * @param hWrappingKey wrapping key's handle for extracted sensible keys. -1 if not used. + * @return key object handle + * @exception PKCS11Exception If an internal PKCS#11 function returns other + * value than CKR_OK. + * @preconditions + * @postconditions + */ + public native long createNativeKey(long hSession, byte[] keyInfo, long hWrappingKey) throws PKCS11Exception; + + /** * C_GenerateKey generates a secret key, creating a new key * object. * (Key management)