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 voidacquireNativeResources()Allocate native resources, setting mPointer and mPointerSize as appropriate.protected voidacquireNativeResourcesInternal()voidaddAttribute(CKAttribute attr)javax.crypto.SecretKeygetKey(javax.crypto.SecretKey parent, long mech, boolean temporary)protected voidreleaseNativeResources()Called to deallocate native resources; note that mPointer.close() is called afterwards.protected voidreleaseNativeResourcesInternal()voidsetAttributes(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.ExceptionDescription copied from class:NativeEnclosureAllocate native resources, setting mPointer and mPointerSize as appropriate.- Specified by:
acquireNativeResourcesin classNativeEnclosure- Throws:
java.lang.Exception
-
releaseNativeResources
protected void releaseNativeResources() throws java.lang.ExceptionDescription copied from class:NativeEnclosureCalled 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:
releaseNativeResourcesin 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
-
-