Thema dieser Dokumentation / Das FirstSpirit 5 Modul- / Komponenten-Modell / FirstSpirit Security Architektur - Java Web Start (javaws) / Zertifikat für Testzwecke erzeugen

Zertifikat für Testzwecke erzeugen

Nachfolgend werden beispielhaft die einzelnen Schritte beschrieben, wie sich ein Zertifikat für Testzwecke erzeugen lässt. Die daraus erzeugte Signierung wird von javaws als nicht vertrauenswürdig eingestuft, da es sich nur um ein Zertifikat für eigene Tests handelt.

# Create a CA certificate that we will use to sign our certificate
# NOTE: make sure the the organisation name for this cert is different
# than the keystore/certificates created later on.
openssl req -x509 -new -out CAcert.crt -keyout CAKey.key -days 365

# Generate a server keystore entry
keytool -genkey -keyalg RSA -alias mycert /
-dname "CN=localhost, OU=Test AG, O=Test AG, L=Beauchief, S=Dortmund, C=DE" /
-keystore keystore.jks -storepass changeit

# Make a certificate request
keytool -certreq -v -alias mycert -keystore keystore.jks -storepass changeit /
-file mycert_request.csr

# Sign the certificate request
openssl x509 -req -in mycert_request.csr -CA CA\CAcert.crt -CAkey CAKey.key /
-CAcreateserial -out mycert_response.crt -extfile /etc/ssl/openssl.cnf /
-extensions v3_ca -days 365

# View the certificate, Make sure it is version 3
keytool -printcert -file mycert_response.crt

# Add the CA cert to the CA keystore
keytool -import -trustcacerts -alias cacert -file CAcert.crt -keystore cacerts.jks /
-storepass changeit

# Add the CA cert to the keystore so that it can find the chain
keytool -import -trustcacerts -alias cacert -file CAcert.crt -keystore keystore.jks /
-storepass changeit

# Add the response certificate that has been signed by the CA,
# Should get a response of "Certificate reply was installed in keystore"
keytool -import -alias mycert -file mycert_response.crt -keystore keystore.jks /
-storepass changeit

© 2005 - 2024 Crownpeak Technology GmbH | Alle Rechte vorbehalten. | FirstSpirit 2024.4 | Datenschutz