Database Usage

IMPORT / EXPORT AEADs, to/from a database using yhsm-db-import and yhsm-db-export

INSTALLATION

On Debian/Ubuntu install

~$ sudo apt-get install python-sqlalchemy (or any other method illustrated at: http://docs.sqlalchemy.org/en/rel_0_8/intro.html#installation)

On other systems: Install SQLAlchemy from http://docs.sqlalchemy.org/en/rel_0_8/intro.html#installation

A database schema is provided to configure the database table for the import/export tools. Create your favourite database and use te schema db_schema provided.

~$ cat doc/db_schema
CREATE TABLE aead_table (
  public_id varchar(16) NOT NULL,
  keyhandle INT NOT NULL,
  aead BLOB NOT NULL,
  PRIMARY KEY (public_id, keyhandle)
);

USAGE

IMPORT: yhsm-db-import aeads_source_folder database_url

EXPORT: yhsm-db-export aeads_destination_folder database_url

Caution
You need to be extra careful when providing sensitive data, such as database credentials, as command line arguments. In some cases these may be logged or visible to other parts of the system. If this is a concern then it is advised to change the database password after importing or exporting data with these scripts.

IMPORT

~$ python yhsm-db-import /root/aeads/ mysql://localhost/database_name

OR

~$ python yhsm-db-import /root/aeads/ mysql://root:password@localhost:3306/database_name

EXPORT

~$ python yhsm-db-export /root/aeads/ mysql://localhost/database_name

OR

~$ python yhsm-db-export /root/aeads/ mysql://root:password@localhost:3306/database_name