When you export credentials using the following command:
$Credential = Get-Credential
$Credential | Export-CliXml -Path “C:\Credentials.Cred”
Then, you want to use these credentials that have been exported previously, in a script for example.
You may get the following error message:
Import-Clixml : Key not valid for use in specified state.
You cannot use these credentials because items encrypted with one account cannot be decrypted using another account.
So, you must “runas” the script with the account you created the credentials file.