'Main function:
- For encrypted password, provides the encrypted version of the password with the master password in order
to allow "LaZagne run initiator" the use the encryption parameter associated with the version of Maven because
encryption parameters can change between version of Maven.
- "LaZagne run initiator" can also use the encrypted password and the master password "AS IS"
in a Maven distribution to access repositories.
See https://github.com/jelmerk/maven-settings-decoder
See https://github.com/sonatype/plexus-cipher/blob/master/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java'

def run(self, software_name=None):

    master_password = self.extract_master_password()
    repos_creds = self.extract_repositories_credentials()
    pwd_found = []
    for creds in repos_creds:
        values = {}
        values['Id'] = creds['id']
        values['Login'] = creds['username']
        if (not self.use_key_auth(creds)):
            pwd = creds['password'].strip()
            if (pwd.startswith('{') and pwd.endswith('}')):
                values['SymetricEncryptionKey'] = master_password
                values['PasswordEncrypted'] = pwd
            else:
                values['Password'] = pwd
        else:
            pk_file_location = creds['privateKey']
            pk_file_location = pk_file_location.replace('${user.home}', constant.profile['USERPROFILE'])
            with open(pk_file_location, 'r') as pk_file:
                values['PrivateKey'] = pk_file.read()
            if ('passphrase' in creds):
                values['Passphrase'] = creds['passphrase']
        pwd_found.append(values)
    return pwd_found
