title: How to create an certificate with 2 key usages using powershell 5
body: <p>I need to create a self-signed certificate to test signed emails using MimeKit.MimeKit. It requires the following KeyUsages:</p>
  
  <ul>
  <li>X509KeyUsageFlags.DigitalSignature </li>
  <li>X509KeyUsageFlags.NonRepudiation</li>
  </ul>
  
  <p>According to documentation this <a href="https://gallery.technet.microsoft.com/scriptcenter/self-signed-certificate-5920a7c6" rel="nofollow noreferrer">powershell</a> command should create it:</p>
  
  <pre><code>New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname tosign.mycompany.pt, mycompany.pt, mycompany.pt -KeyLength 4096 
  -keyUsage "DigitalSignature, NonRepudiation"
  </code></pre>
  
  <p>but it throws:</p>
  
  <pre><code>New-SelfSignedCertificate : Cannot bind parameter 'KeyUsage'. Cannot convert value "DigitalSignature, NonRepudiation"
  </code></pre>