Reputation: 35
I need to get SSH public key from the certificate which is store on azure portal and I have created workflow on azure automation and import the certificate to azure portal. Once we get the SSH public key, I have to create linux VM with this SSH public key(Ready this script from myend without add SSH key).
Upvotes: 0
Views: 1225
Reputation: 6255
Based on my understanding, your certificate should be DER encoded X.509 certificate with .cer extension.
You can get the public key from your certificate using the PowerShell script below:
$certPath = "testcert.cer"
$x509Cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromCertFile($certPath)
$pk = $x509Cert.GetPublicKeyString()
Hope this helps!
Upvotes: 1