Skip to content

Tests CertTool

Javier Gusano Martinez edited this page Dec 1, 2016 · 4 revisions

Tests: Certificate Tool

For the situations where you need generate a large number of certificates and provision all of them inside Redis DB automatically, since KeyServer v0.3.2, we have included in this repository two bash scripts under 'tools' directory.

The current diagram shows the tool architecture:

+-----------+         +---------------+         +------------+
|genCerts.sh|-------->|               |         |            |
+-----------+         |               |         |  REDIS DB  |
                      |               |         |  ========  |
                      |pk-provider.jar|<------->|            |
                      |               |         |            |
+-----------+         |               |         |            |
|cleanDb.sh |-------->|               |         |            |
+-----------+         +-------^-------+         +------------+
                              |
                              |
                         .---------. 
                         |         |\
                         |         |_\
                         |           |
                         |PK Provider|
                         |  Config.  |
                         ·-----------·
                       general.properties

Warning The 'general.properties' file is required for a correct connection between the Private Key Provider Tool and Redis DB.

PK Provider configuration file.

The content of this file is very simple and can use your 'general.properties' from a KeyServer previously configured.

This is a template for this file:

# Copyright 2016.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

## Data Base Configuration
dbAddress=127.0.0.1
dbPort=6379
dbPassword=foobared

Generate and Provision Certificates Automatically

This script 'genCerts.sh' is used to generate certificates with his associated private key. All of them will be stored inside Redis DB automatically. The certificate will be generated under 'certs' directory.

Example: Generate and provision 5 certificates

  1. Write the following command writing the number of certificates to generate as input parameter: ./genCerts 5
  2. Now you can access to the new certificates inside 'certs' directory. The database contains the private keys associated to each certificate fingerprint.

Clean All DB Certificates

The current script will delete all certificates provisioned on Redis Database.

Example: Clean Redis DB

  1. Write the following command: ./cleanDb.sh
Clone this wiki locally