How to check, if a private key is a valid Let's Encrypt account key?

You can now do this pretty easily in the dev build of Posh-ACME. I haven't shipped an official release with it yet though, so you'd have to use the Github copy until I do.

Set-PAServer LE_PROD  # or whatever ACME CA
New-PAAccount -KeyFile .\mystery.key -OnlyReturnExisting

Boulder (other ACME CAs may vary) will throw an error if the account doesn't exist or a slightly different error if it has been deactivated already. If a valid account does exist, it will get returned as normal and you can then deactivate and remove it like this.

Set-PAAccount -Deactivate -Force
Get-PAAccount | Remove-PAAccount -Force
3 Likes