certutil options ?

46 views
Skip to first unread message

Usha Nayak

unread,
Jul 31, 2020, 12:12:53 PM7/31/20
to mozilla-de...@lists.mozilla.org
Hello

I have a following requirement:

a) create a new NSS SQLite DB
b) copy existing data from our prior SQLite DB into newer DB.

On perusing, I came across below command:

The --merge command only requires information about the
location of the original database; since it doesn't change the
format of the database, it can write over information without
performing interim step.
certutil --merge -d [sql:]directory [-P dbprefix] --source-dir directory
--source-prefix dbprefix [-@ password-file]

For example:
$ certutil --merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/
alias/ --source-prefix serverapp-



Does this create the new SQLite DB ?
Is -d [sql:]directory option creating new SQLite DB or is that original DB ?
Not quite sure what --source-dir option is or for that matter --source-prefix?


Any help greatly appreciated.

Thanks..

Usha Nayak

unread,
Jul 31, 2020, 5:17:41 PM7/31/20
to mozilla-de...@lists.mozilla.org
I tried below scenario:

Database 1: (Create password file pwdfile.txt containing 'merge')
Create DB -> \NSS-3.51.1\bin>modutil -create -dbdir sql:D:\MergeTest\NSS_orig\db
Generate KeyPair -> \NSS-3.51.1\bin>certutil -G -d sql:D:\MergeTest\NSS_orig\db
Assign Password -> \NSS-3.51.1\bin>modutil -dbdir sql:D:\MergeTest\NSS_orig\db -changepw "NSS Certificate DB" (password: merge)


Database 2: (Create password file pwdfile.txt containing 'merge1')
Create DB -> \NSS-3.51.1\bin>modutil -create -dbdir sql:D:\MergeTest\NSS_new\db
Assign Password -> \NSS-3.51.1\bin>modutil -dbdir sql:D:\MergeTest\NSS_new\db -changepw "NSS Certificate DB" (password: merge1)

Execute merge command:
\NSS-3.51.1\bin>certutil --merge -d sql:D:\MergeTest\NSS_new\db --source-dir sql:D:\MergeTest\NSS_orig\db -f D:\MergeTest\NSS_new\pwdfile.txt @ D:\MergeTest\NSS_orig\pwdfile.txt
certutil: couldn't open source database: SEC_ERROR_UNKNOWN_PKCS11_ERROR: Unknown PKCS #11 error.


Please let me know.

Thanks..



Reply all
Reply to author
Forward
0 new messages