- def can_open_keystore_and_truststore_with_pass(self):
- can_open_keystore = self.can_open_jks_file_with_pass_file(self.keystorePassPath, self.keystoreJksPath)
- can_open_truststore = self.can_open_jks_file_with_pass_file(self.truststorePassPath, self.truststoreJksPath)
+ def can_open_keystore_and_truststore_jks_files(self):
+ try:
+ jks.KeyStore.load(self.keystoreJksPath, open(self.keystorePassPath, 'rb').read())
+ jks.KeyStore.load(self.truststoreJksPath, open(self.truststorePassPath, 'rb').read())
+ return True
+ except Exception as e:
+ print("UnExpected Error in validating keystore.jks/truststore.jks: {0}".format(e))
+ return False
+
+ # Function to validate keystore.p12/truststore.p12 can be opened with generated pass-phrase.
+ def can_open_keystore_and_truststore_p12_files(self):
+ can_open_keystore = self.can_open_p12_file_with_pass_file(self.keystorePassPath, self.keystoreP12Path)
+ can_open_truststore = self.can_open_p12_file_with_pass_file(self.truststorePassPath, self.truststoreP12Path)