def get_truststore_password(properties): truststore_password = properties.get_property(SSL_TRUSTSTORE_PASSWORD_PROPERTY) isSecure = get_is_secure(properties) if truststore_password: if isSecure: truststore_password = decrypt_password_for_alias(properties, SSL_TRUSTSTORE_PASSWORD_ALIAS) else: truststore_password = read_password("", ".*", "Password for TrustStore:", "Invalid characters in password") if truststore_password: encrypted_password = get_encrypted_password(SSL_TRUSTSTORE_PASSWORD_ALIAS, truststore_password, properties) properties.process_pair(SSL_TRUSTSTORE_PASSWORD_PROPERTY, encrypted_password) return truststore_password
def get_and_persist_truststore_password(properties): truststore_password = properties.get_property(SSL_TRUSTSTORE_PASSWORD_PROPERTY) isSecure = get_is_secure(properties) if truststore_password: if isSecure: truststore_password = decrypt_password_for_alias(properties, SSL_TRUSTSTORE_PASSWORD_ALIAS) else: truststore_password = read_password("", ".*", "Password for TrustStore:", "Invalid characters in password") if truststore_password: encrypted_password = get_encrypted_password(SSL_TRUSTSTORE_PASSWORD_ALIAS, truststore_password, properties) properties.process_pair(SSL_TRUSTSTORE_PASSWORD_PROPERTY, encrypted_password) return truststore_password