Class 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.
    • 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 class NativeEnclosure
        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 class NativeEnclosure
        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