Class EncryptionKey


  • public final class EncryptionKey
    extends java.lang.Object
    ENTERPRISE EDITION API

    An encryption key for a database. This is a symmetric key that be kept secret. It should be stored either in the Keychain, or in the user's memory (hopefully not a sticky note.)

    • Constructor Summary

      Constructors 
      Constructor Description
      EncryptionKey​(byte[] key)
      Initializes the encryption key with a raw AES-128 key 16 bytes in length.
      EncryptionKey​(java.lang.String password)
      Initializes the encryption key from the given password string.
    • Method Summary

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EncryptionKey

        public EncryptionKey​(@NonNull
                             byte[] key)
        Initializes the encryption key with a raw AES-128 key 16 bytes in length. To create a key, generate random data using a secure cryptographic randomizer.

        Parameters:
        key - The raw AES-128 key data.
      • EncryptionKey

        public EncryptionKey​(@NonNull
                             java.lang.String password)
        Initializes the encryption key from the given password string. The password string will be internally converted to a raw AES-128 key using 64,000 rounds of PBKDF2 hashing.
        Parameters:
        password - The password string.