I have not been able to find an official method for retrieving a private key in plaintext. So I've gotten obscenely stupid solving this problem. I'm curious if anyone has a better way of doing this. If you don't revert everything to original values with this approach then looking at the properties of the buffer session in the GUI will cause RDM to lock up. This is clearly a hack approach, which is ugly and time consuming, but it works.
$SessionBuffer = "Buffer" $SessionKey = "PrivateKeySession" #Get a sacrifical username/password credential session to use as a buffer $cred1 = Get-RDMTCredential -name $SessionBuffer #Get the private key session where your private key is stored $cred2 = Get-RDMTCredential -name $SessionKey #Save the buffer session password for later $Revert = $Cred1.Credentials.SafePassword #Set the buffer session password to the private key session private key $Cred1.Credentials.SafePassword = $Cred2.Credentials.SafePrivateKeyData #refresh the buffer session $Cred1 | set-RDMSession -refresh #reacquire the buffer session with the new values. $Cred1 = Get-RDMTCredential -name $SessionBuffer #Get the "password" from the buffer session $PrivateKey = $Cred1 | Get-RDMSessionPassword -asplaintext #Return the original password value to the buffer session $Cred1.Credentials.SafePassword = $Revert #Refresh the buffer session one last time $Cred1 | set-RDMSession -refresh #You should have the original plain text private key value now. $PrivateKey
Hello,
Indeed there is no official method yet to retrieve a private key from an entry using the RDM PowerShell module.
Thank you for your workaround!
Best regards,
Érica Poirier