text: /* 
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  /**
   * Author:  Ender
   * Created: Oct 13, 2017
   */
  CREATE TABLE CERTIFICATES (ID_CERT INTEGER PRIMARY KEY, CERTNAME VARCHAR(200),CN VARCHAR(200),ALGO VARCHAR(64),CERTFILE BLOB,SHA256  VARCHAR(256),THUMBPRINT  VARCHAR(256),ID_ISSUER_CERT INTEGER, ID_PRIVATEKEY INTEGER, CERTTYPE INTEGER, EXPIRYDATE DATE, SERIAL VARCHAR(10), ACSERIALCURSOR VARCHAR(10), CRLLASTUPDATE DATE, STATUS VARCHAR(12));
  CREATE SEQUENCE CERTIFICATES_SEQ START WITH 1 INCREMENT BY 1;
  CREATE TABLE X509KEYS (ID_KEY INTEGER PRIMARY KEY,	KEYNAME VARCHAR(200), KEYTYPE INTEGER,KEYFILE BLOB, ALGO VARCHAR(64), SHA256  VARCHAR(256),ID_ASSOCIATED_KEY INTEGER);
  CREATE SEQUENCE X509KEYS_SEQ START WITH 1 INCREMENT BY 1;
  CREATE TABLE PGPKEYS (ID_KEY INTEGER PRIMARY KEY, KEYNAME VARCHAR(64),KEYTYPE INTEGER,ALGO VARCHAR(64),SHA256  VARCHAR(256), ID_PARENT_KEY INTEGER);
  CREATE SEQUENCE PGPKEYS_SEQ START WITH 1 INCREMENT BY 1;
  CREATE TABLE CRLS (ID_CRL INTEGER PRIMARY KEY, CRLFILE BLOB,ID_CA_CERT INTEGER, DAYCYCLE INTEGER, STARTDATE DATE, ENDDATE DATE);
  CREATE SEQUENCE CRLS_SEQ START WITH 1 INCREMENT BY 1;
  
  /* ALGO */
  CREATE TABLE ALGO (ID_ALGO INTEGER PRIMARY KEY, ALGONAME VARCHAR(64), TYPE VARCHAR(64));
  CREATE SEQUENCE ALGO_SEQ START WITH 1 INCREMENT BY 1;
  /* SIGNATURE ALGORITHMS from DefaultSignatureAlgorithmIdentifierFinder class */
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'MD2WITHRSAENCRYPTION','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'MD2WITHRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'MD5WITHRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA1WITHRSA ','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA224WITHRSA ','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA256withRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA384withRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA512withRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA1WITHRSAANDMGF1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA224WITHRSAANDMGF1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA256WITHRSAANDMGF1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA384WITHRSAANDMGF1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA512WITHRSAANDMGF1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'RIPEMD160WITHRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'RIPEMD128WITHRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'RIPEMD256WITHRSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA1WITHDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'DSAWITHSHA1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA224WITHDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA256WITHDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA384WITHDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA512WITHDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA1WITHECDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'ECDSAWITHSHA1','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA224WITHECDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA256WITHECDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA384WITHECDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SHA512WITHECDSA','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'GOST3411WITHGOST3410','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'GOST3411WITHGOST3410-94','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'GOST3411WITHECGOST3410','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'GOST3411WITHECGOST3410-2001','SIGNATURE');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'GOST3411WITHGOST3410-2001','SIGNATURE');
  /* PRIVATE KEY ALGORITHMS from RSA DSA DH (DiffieHellman) */
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'RSA','PKCS8');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'DSA','PKCS8');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'DH','PKCS8');
  /* CIPHER ALGORITHMS */
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'DES_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'DES_EDE3_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'RC2_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'IDEA_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'CAST5_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'AES128_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'AES192_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'AES256_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'CAMELLIA128_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'CAMELLIA192_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'CAMELLIA256_CBC','CIPHER');
  INSERT INTO ALGO VALUES (NEXT VALUE FOR ALGO_SEQ, 'SEED_CBC','CIPHER');