Package org.mozilla.jss.crypto
Class KBKDFDerivedKey
- java.lang.Object
-
- org.mozilla.jss.util.NativeEnclosure
-
- org.mozilla.jss.crypto.KBKDFDerivedKey
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class KBKDFDerivedKey extends NativeEnclosure
Class for supporting additional derived keys from PKCS#11 v3.0's SP800-108 KBKDF implementation.
-
-
Field Summary
-
Fields inherited from class org.mozilla.jss.util.NativeEnclosure
mPointer, mPointerSize
-
-
Constructor Summary
Constructors Constructor Description KBKDFDerivedKey()
KBKDFDerivedKey(CKAttribute[] attrs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
acquireNativeResources()
Allocate native resources, setting mPointer and mPointerSize as appropriate.protected void
acquireNativeResourcesInternal()
void
addAttribute(CKAttribute attr)
javax.crypto.SecretKey
getKey(javax.crypto.SecretKey parent, long mech, boolean temporary)
protected void
releaseNativeResources()
Called to deallocate native resources; note that mPointer.close() is called afterwards.protected void
releaseNativeResourcesInternal()
void
setAttributes(CKAttribute[] attrs)
-
Methods inherited from class org.mozilla.jss.util.NativeEnclosure
close, finalize, open
-
-
-
-
Constructor Detail
-
KBKDFDerivedKey
public KBKDFDerivedKey()
-
KBKDFDerivedKey
public KBKDFDerivedKey(CKAttribute[] attrs) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
setAttributes
public void setAttributes(CKAttribute[] attrs) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
addAttribute
public void addAttribute(CKAttribute attr) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
acquireNativeResources
protected void acquireNativeResources() throws java.lang.Exception
Description copied from class:NativeEnclosure
Allocate native resources, setting mPointer and mPointerSize as appropriate.- Specified by:
acquireNativeResources
in classNativeEnclosure
- Throws:
java.lang.Exception
-
releaseNativeResources
protected void releaseNativeResources() throws java.lang.Exception
Description copied from class:NativeEnclosure
Called to deallocate native resources; note that mPointer.close() is called afterwards. If mPointer.close() should be a no-op, extend from StaticVoidRef and do any required cleanup here.- Specified by:
releaseNativeResources
in classNativeEnclosure
- Throws:
java.lang.Exception
-
getKey
public javax.crypto.SecretKey getKey(javax.crypto.SecretKey parent, long mech, boolean temporary) throws java.lang.Exception
- Throws:
java.lang.Exception
-
acquireNativeResourcesInternal
protected void acquireNativeResourcesInternal() throws java.lang.Exception
- Throws:
java.lang.Exception
-
releaseNativeResourcesInternal
protected void releaseNativeResourcesInternal() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-