def postConfigure(self): if self.cisTrue("create_keystore"): utils.execKeytool("Creating the new key/certificate", "-genkeypair", "pkcs12", self.cget("keystore"), self.cget("password"), self.cget("keyalias"), self.cget("keypassword"), [("-dname", self.cget("distinguished_name")), ("-keyalg", "EC")])
def postConfigure(self): if self.cisTrue("create_keystore"): p12keystore = self.cget("p12_keystore") utils.execKeytool( "Creating the new key/certificate", "-genkeypair", "pkcs12", self.cget("p12_keystore"), self.cget("password"), self.cget("keyalias"), self.cget("keypassword"), [("-dname", self.cget("distinguished_name")), ("-keyalg", "RSA")], ) self.cset("keystore", p12keystore) if self.cisTrue("exportkeystore_tojks"): jkskeystore = self.cget("keystore").rpartition(".")[0] jkskeystore += ".jks" utils.execSrcToDestKeyTool( "Convert keystore from PKCS#12 to JKS", "-importkeystore", "pkcs12", self.cget("keystore"), self.cget("password"), self.cget("keyalias"), "jks", jkskeystore, self.cget("password"), self.cget("keyalias"), [], ) self.cset("jks_keystore", jkskeystore) self.cset("keystore", jkskeystore) if self.cisTrue("exportkeystore_topem"): pemkeystore = self.cget("p12_keystore").rpartition(".")[0] pemkeystore += ".pem" utils.execSrcToDestOpenssl( "Convert keystore from PKCS#12 to PEM", "pkcs12", self.cget("p12_keystore"), self.cget("password"), pemkeystore, self.cget("password"), [], ) self.cset("pem_keystore", pemkeystore) if self.cisTrue("create_certfile"): typekeystore = "jks" if self.cget("keystore").endswith(".jks") else "pkcs12" utils.execKeytool( "Exporting certificate", "-exportcert", typekeystore, self.cget("keystore"), self.cget("password"), self.cget("keyalias"), self.cget("keypassword"), [("-file", self.cget("certfile"))], ) if self.cisTrue("create_truststore"): utils.execKeytool( "Creating truststore", "-importcert", "jks", self.cget("truststore"), self.cget("trustpassword"), self.cget("trust_keyalias"), self.cget("trust_keypassword"), [("-file", self.cget("certfile")), ("-noprompt", "")], ) if self.cisTrue("create_truststore_pem"): pemtruststore = self.cget("truststore").rpartition(".")[0] pemtruststore += ".pem" utils.execOpenssl( "Creating truststore in PEM format", "x509", [("-inform", "DES"), ("-in", self.cget("certfile")), ("-out", pemtruststore)], ) self.cset("pem_truststore", pemtruststore)