我需要创建一个自签名证书来使用MimeKit.MimeKit测试签名的电子邮件。它需要以下KeyUsages:
根据文档,这个powershell命令应该创建它:
New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname tosign.mycompany.pt, mycompany.pt, mycompany.pt -KeyLength 4096
-keyUsage "DigitalSignature, NonRepudiation"
但它抛出:
New-SelfSignedCertificate : Cannot bind parameter 'KeyUsage'. Cannot convert value "DigitalSignature, NonRepudiation"
New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname osign.mycompany.pt, mycompany.pt, mycompany.pt -KeyLength 4096 -keyUsage DigitalSignature,NonRepudiation