# Keytool import export

**URL:** <https://support.openanalytics.eu/t/keytool-import-export/2631>\
**Category:** ShinyProxy\
**Created:** [September 6, 2023, 5:55pm UTC](https://support.openanalytics.eu/t/keytool-import-export/2631 "2023-09-06T17:55:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kramerrs](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/kramerrs/32/793_2.png) [@kramerrs](https://support.openanalytics.eu/u/kramerrs)\
**Post date:** [September 6, 2023, 5:55pm UTC](https://support.openanalytics.eu/t/keytool-import-export/2631/1 "2023-09-06T17:55:54Z")

</div>

I am trying to launch ShinyProxy in a docker container.

If I run key tool then launch ShinyProxy, the keystore is loaded, however if I try to export the certificate save it in a pem file and reload it, ShinyProxy won’t load the keystore and errors out. This is important because the keytool isn’t deterministic, and generates a different certificate each run.

rm samlKeystore.jks

keytool -deststoretype pkcs12   
-genkeypair   
-keyalg RSA   
-keysize 4096   
-sigalg SHA256withRSA   
-validity 1460   
-alias shinyproxy-saml   
-keystore /home/docker/data/samlKeystore.jks   
-storepass:file saml\_cert\_password -dname “fill in the blanks”

keytool -exportcert -alias shinyproxy-saml -keystore samlKeystore.jks -rfc -file cert.pem -storepass:file saml\_cert\_password

keytool -importcert -file saml\_cert.pem -keystore samlKeystore.jks -alias shinyproxy-saml -storepass:file saml\_cert\_password -noprompt
