< prev index next >
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
Print this page
*** 1289,1298 ****
--- 1289,1330 ----
/* *****************************************************************************
* Key management
******************************************************************************/
/**
+ * 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)
*
* @param hSession the session's handle
< prev index next >