title: Unable to create database encryption key
body: <p>i'm learning database encryption and i'm actualy confuse about a mistake that hapen when i try to enable encryption on my database.</p>
  
  <p>So here it is what i do to create the certificate</p>
  
  <pre><code>    /* Certificat de base de données */
  
      CREATE CERTIFICATE certTestEncryption
      WITH SUBJECT='Certificat TestEncryption';
  
      /* Chiffrage de la BDD */
  
      SELECT * FROM sys.certificates
  </code></pre>
  
  <p>And there it is what i got :
  <a href="https://i.stack.imgur.com/0N5EC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0N5EC.png" alt="certificat of my database &#39;testEncryption&#39;"></a></p>
  
  <p>So my certificate actually exist.</p>
  
  <p>But when i try to execute this statement :</p>
  
  <pre><code>CREATE DATABASE ENCRYPTION KEY
  WITH ALGORITHM=AES_256
  ENCRYPTION BY SERVER CERTIFICATE certTestEncryption;
  </code></pre>
  
  <p>It is not working at all and give me the folowing error message :</p>
  
  <blockquote>
    <p>Cannot find the certificate "certTestEncryption" because it does not
    exist or you do not have authorization.</p>
  </blockquote>
  
  <p>So i try this one</p>
  
  <pre><code>EXECUTE AS LOGIN = 'sa';
  CREATE DATABASE ENCRYPTION KEY
  WITH ALGORITHM=AES_256
  ENCRYPTION BY SERVER CERTIFICATE certTestEncryption;
  </code></pre>
  
  <p>But it still give me the same error as evoked prior.</p>
  
  <p>I have also try to encryption by asymmetric key :</p>
  
  <pre><code>EXECUTE AS LOGIN = 'sa';
  CREATE DATABASE ENCRYPTION KEY
  WITH ALGORITHM=AES_256
  ENCRYPTION BY SERVER ASYMMETRIC KEY asymKey;
  </code></pre>
  
  <p>It still give me this error : 
  Unable to find the asymmetric key "asymmetricKey" because it does not exist or you do not have authorization.</p>
  
  <p>Even if the asymmetric key actually exist :
  <a href="https://i.stack.imgur.com/M3Rvf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M3Rvf.png" alt="Database encryption by asymmetric key"></a></p>