public interface GordianWrapper
GordianKnot base for Wrap Cipher.
  • Method Details

    • getKeySpec

      GordianSymKeySpec getKeySpec()
      Obtain the keyType.
      Returns:
      the keyType
    • secureKey

      byte[] secureKey(GordianKey<?> pKeyToSecure) throws GordianException
      Secure key.
      Parameters:
      pKeyToSecure - the key to secure
      Returns:
      the securedKey
      Throws:
      GordianException - on error
    • deriveKey

      <T extends GordianKeySpec> GordianKey<T> deriveKey(byte[] pSecuredKey, T pKeyType) throws GordianException
      Derive key from bytes.
      Type Parameters:
      T - type of key to be derived
      Parameters:
      pSecuredKey - the securedKey
      pKeyType - the type of key to be derived
      Returns:
      the derived key
      Throws:
      GordianException - on error
    • securePrivateKey

      byte[] securePrivateKey(GordianKeyPair pKeyPair) throws GordianException
      Secure privateKey.
      Parameters:
      pKeyPair - the keyPair to secure
      Returns:
      the securedPrivateKey
      Throws:
      GordianException - on error
    • deriveKeyPair

      GordianKeyPair deriveKeyPair(X509EncodedKeySpec pPublicKeySpec, byte[] pSecuredPrivateKey) throws GordianException
      Derive the keyPair from the PKCS8/X509 encodings.
      Parameters:
      pPublicKeySpec - the publicKeySpec
      pSecuredPrivateKey - the secured privateKey
      Returns:
      the derived keyPair
      Throws:
      GordianException - on error
    • secureBytes

      byte[] secureBytes(byte[] pBytesToSecure) throws GordianException
      secure bytes.
      Parameters:
      pBytesToSecure - the bytes to secure
      Returns:
      the securedBytes
      Throws:
      GordianException - on error
    • deriveBytes

      default byte[] deriveBytes(byte[] pSecuredBytes) throws GordianException
      derive bytes.
      Parameters:
      pSecuredBytes - the secured bytes
      Returns:
      the derivedBytes
      Throws:
      GordianException - on error
    • deriveBytes

      byte[] deriveBytes(byte[] pSecuredBytes, int pOffset) throws GordianException
      derive bytes.
      Parameters:
      pSecuredBytes - the secured bytes
      pOffset - the offset within the secured bytes
      Returns:
      the derivedBytes
      Throws:
      GordianException - on error
    • getKeyWrapLength

      int getKeyWrapLength(GordianKey<?> pKey)
      Obtain wrapped size of a key.
      Parameters:
      pKey - the keyToWrap
      Returns:
      the wrapped length
    • getDataWrapLength

      int getDataWrapLength(int pDataLength)
      Obtain wrapped size of a byte array of the given length.
      Parameters:
      pDataLength - the length of the byte array
      Returns:
      the wrapped length
    • getPrivateKeyWrapLength

      int getPrivateKeyWrapLength(GordianKeyPair pKeyPair) throws GordianException
      Obtain wrapped size of the privateKey of a keyPair.
      Parameters:
      pKeyPair - the keyPair
      Returns:
      the wrapped length
      Throws:
      GordianException - on error