public interface GordianKeySet
keySet API.
  • Method Details

    • getKeySetSpec

      GordianKeySetSpec getKeySetSpec()
      Obtain the keySetSpec.
      Returns:
      the keySetSpec
    • createCipher

      GordianKeySetCipher createCipher() throws GordianException
      Create a keySetCipher.
      Returns:
      the keySetCipher
      Throws:
      GordianException - on error
    • encryptBytes

      byte[] encryptBytes(byte[] pBytesToEncrypt) throws GordianException
      Encrypt bytes.
      Parameters:
      pBytesToEncrypt - the bytes to encrypt
      Returns:
      the encrypted bytes
      Throws:
      GordianException - on error
    • decryptBytes

      byte[] decryptBytes(byte[] pBytesToDecrypt) throws GordianException
      Decrypt bytes.
      Parameters:
      pBytesToDecrypt - the bytes to decrypt
      Returns:
      the decrypted bytes
      Throws:
      GordianException - on error
    • createAADCipher

      GordianKeySetAADCipher createAADCipher() throws GordianException
      Create a keySetAADCipher.
      Returns:
      the keySetCipher
      Throws:
      GordianException - on error
    • encryptAADBytes

      default byte[] encryptAADBytes(byte[] pBytesToEncrypt) throws GordianException
      Encrypt AAD bytes.
      Parameters:
      pBytesToEncrypt - the bytes to encrypt
      Returns:
      the encrypted bytes
      Throws:
      GordianException - on error
    • encryptAADBytes

      byte[] encryptAADBytes(byte[] pBytesToEncrypt, byte[] pAAD) throws GordianException
      Encrypt AAD bytes.
      Parameters:
      pBytesToEncrypt - the bytes to encrypt
      pAAD - the AAD data
      Returns:
      the encrypted bytes
      Throws:
      GordianException - on error
    • decryptAADBytes

      default byte[] decryptAADBytes(byte[] pBytesToDecrypt) throws GordianException
      Decrypt AAD bytes.
      Parameters:
      pBytesToDecrypt - the bytes to decrypt
      Returns:
      the decrypted bytes
      Throws:
      GordianException - on error
    • decryptAADBytes

      byte[] decryptAADBytes(byte[] pBytesToDecrypt, byte[] pAAD) throws GordianException
      Decrypt AAD bytes.
      Parameters:
      pBytesToDecrypt - the bytes to decrypt
      pAAD - the AAD data
      Returns:
      the decrypted bytes
      Throws:
      GordianException - on error
    • secureKeySet

      byte[] secureKeySet(GordianKeySet pKeySetToSecure) throws GordianException
      secure KeySet.
      Parameters:
      pKeySetToSecure - the keySet to secure
      Returns:
      the encryptedKeySet
      Throws:
      GordianException - on error
    • deriveKeySet

      GordianKeySet deriveKeySet(byte[] pSecuredKeySet) throws GordianException
      derive KeySet.
      Parameters:
      pSecuredKeySet - the secured keySet
      Returns:
      the decrypted keySet
      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

      byte[] deriveBytes(byte[] pSecuredBytes) throws GordianException
      derive bytes.
      Parameters:
      pSecuredBytes - the secured bytes
      Returns:
      the derivedBytes
      Throws:
      GordianException - on error
    • 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.
      Type Parameters:
      T - the keyType class
      Parameters:
      pSecuredKey - the secured key
      pKeyType - the key type
      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 keyPair.
      Parameters:
      pPublicKeySpec - the publicKeySpec
      pSecuredPrivateKey - the secured privateKey
      Returns:
      the keyPair
      Throws:
      GordianException - on error
    • getKeyWrapLength

      int getKeyWrapLength(GordianLength pKeyLen)
      Obtain wrapped size of a key.
      Parameters:
      pKeyLen - the keyLength
      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
    • getKeySetWrapLength

      int getKeySetWrapLength()
      Obtain the keySet wrap length.
      Returns:
      the length
    • cloneIt

      Clone the keySet.
      Returns:
      the cloned keySet
      Throws:
      GordianException - on error