/**
 * Method to generate a new encryption key object.
 *
 * @param   array  $options  Key generation options.
 *
 * @return  Key
 *
 * @since   3.8.0
 * @throws  \RuntimeException
 */
public function generateKey(array $options = array())
{
    // Generate the encryption key.
    $pair = Compat::crypto_box_keypair();
    return new Key('sodium', Compat::crypto_box_secretkey($pair), Compat::crypto_box_publickey($pair));
}