title: How to save CryptoKey in LocalStorage?
body: <p>I want to use Web Cryptography API on an already existing project. 
  To encrypt and decrypt something I have to use an CryptoKey, but when I save to CryptoKey into localStorage it only saves the String (CryptoKey) instead of the object.</p>
  
  <p>Is it possible to serialize / convert an CryptoKey in an simple type (string)?</p>
  
  <p>My decrypting method is </p>
  
  <pre><code>function decryptDataWithAES(keyName)
  {
      var decrypt_promise; 
      var aesKey = localStorage.getItem(keyName + 'key')
      var item = localStorage.getItem(keyName)
      var invokeVektor = localStorage.getItem(keyName + 'vector')
      console.log("aesKey", aesKey )
  
      crypto.subtle.decrypt({ name: "AES-CBC", iv: invokeVektor }, aesKey, item).then(function (result) {
          decrypted_data = new Uint8Array(result); decrypted_data = new Uint8Array(result);
  
          decrypt_promise = convertArrayBufferViewtoString(decrypted_data);
          console.log('decryptDataWithAES ' + decrypt_promise);
          return decrypt_promise; 
      },
          function(e){
              console.log(e.message);
          }
      );
  }
  </code></pre>
  
  <p>The error message is of course: </p>
  
  <blockquote>
    <p>Failed to execute 'decrypt' on 'SubtleCrypto': parameter 2 is not of type 'CryptoKey'. 2localStorageHandler.js:39 CryptoPromise[object CryptoKey]</p>
  </blockquote>
  
  <p>If I decrypt without using localStorage there is no problem with encrypting the data. </p>