Tested using CA signed cert 70/4470/3
authorPatrikBuhr <patrik.buhr@est.tech>
Wed, 29 Jul 2020 06:31:15 +0000 (08:31 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Wed, 29 Jul 2020 14:39:24 +0000 (16:39 +0200)
Tested using a CA signed cert and trusting the CA.
Added a README file describing how the keystore.jks
and the truststore.jks can be created.

Change-Id: I431e716f830a3dc1d02f9ac53dddca6a678ace43
Issue-ID: NONRTRIC-195
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
policy-agent/config/README [new file with mode: 0644]
policy-agent/config/keystore.jks
policy-agent/config/truststore.jks

diff --git a/policy-agent/config/README b/policy-agent/config/README
new file mode 100644 (file)
index 0000000..6e50749
--- /dev/null
@@ -0,0 +1,41 @@
+The keystore.jks and truststore.jks files are created by using the following commands (note that this is an example):
+
+1) Create a CA certificate and a private key:
+
+openssl genrsa -des3 -out CA-key.pem 2048
+openssl req -new -key CA-key.pem -x509 -days 1000 -out CA-cert.pem 
+
+2) Create a keystore with a private key entry that is signed by the CA:
+
+keytool -genkeypair -alias policy_agent -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 3650 -storepass policy_agent
+keytool -certreq -alias policy_agent -file request.csr -keystore keystore.jks -ext san=dns:your.domain.com -storepass policy_agent
+openssl x509 -req -days 365 -in request.csr -CA CA-cert.pem -CAkey CA-key.pem -CAcreateserial -out ca_signed-cert.pem
+keytool -importcert -alias ca_cert -file CA-cert.pem -keystore keystore.jks -trustcacerts -storepass policy_agent
+keytool -importcert -alias policy_agent -file ca_signed-cert.pem -keystore keystore.jks -trustcacerts -storepass policy_agent
+
+
+3) Create a trust store containing the CA cert (to trust all certs signed by the CA):
+
+keytool -genkeypair -alias not_used -keyalg RSA -keysize 2048 -keystore truststore.jks -validity 3650 -storepass policy_agent
+keytool -importcert -alias ca_cert -file CA-cert.pem -keystore truststore.jks -trustcacerts -storepass policy_agent
+
+
+4) Command for listing of the contents of jks files, examples:
+keytool -list -v -keystore keystore.jks -storepass policy_agent
+keytool -list -v -keystore truststore.jks -storepass policy_agent
+
+## License
+
+Copyright (C) 2020 Nordix Foundation. All rights reserved.
+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.
+
index 4df793d..122997a 100644 (file)
Binary files a/policy-agent/config/keystore.jks and b/policy-agent/config/keystore.jks differ
index 1845abe..60d6288 100644 (file)
Binary files a/policy-agent/config/truststore.jks and b/policy-agent/config/truststore.jks differ