[英]how to get public key from certificate on azure automation
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. 我需要从存储在azure门户上的证书中获取SSH公钥,并且已经在azure自动化上创建了工作流程并将证书导入到azure门户中。 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). 一旦我们获得了SSH公钥,我就必须使用此SSH公钥创建linux VM(从myend读取此脚本,而无需添加SSH密钥)。
Based on my understanding, your certificate should be DER encoded X.509 certificate with .cer extension. 根据我的理解,您的证书应该是扩展名为.cer的 DER编码X.509证书。
You can get the public key from your certificate using the PowerShell script below: 您可以使用以下PowerShell脚本从证书中获取公钥:
$certPath = "testcert.cer"
$x509Cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromCertFile($certPath)
$pk = $x509Cert.GetPublicKeyString()
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.