title: Crypto.subtle in Dart?
body: <p>Is there any package or utilities related to <code>crypto.subtle</code> present in Dart?
  I found <a href="https://api.dart.dev/stable/2.17.6/dart-html/Crypto/subtle.html" rel="nofollow noreferrer">this</a> but I believe that's read-only, not accessible and for browsers only.</p>
  <p>I am looking for something similar for this piece of code in dart</p>
  <pre class="lang-js prettyprint-override"><code> static async CbcEncrypt(data: Uint8Array, iv: Uint8Array, key: Uint8Array): Promise&lt;Uint8Array&gt; {
      const importedKey = await crypto.subtle.importKey(
        'raw',
        key,
        {
          //this is the algorithm options
          name: 'AES-CBC',
        },
        false, //whether the key is extractable (i.e. can be used in exportKey)
        ['encrypt', 'decrypt'] //can be &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, or &quot;unwrapKey&quot;
      );
  
      const cipher = await crypto.subtle.encrypt(
        {
          name: 'AES-CBC',
          iv: iv,
        },
        importedKey, //from generateKey or importKey above
        data //ArrayBuffer of data you want to encrypt
      );
  
      return new Uint8Array(cipher);
    }
  </code></pre>
  <p>I looked at various packages <a href="https://pub.dev/packages/crypto" rel="nofollow noreferrer">crypto</a>, <a href="https://pub.dev/packages/webcrypto" rel="nofollow noreferrer">webcrypto</a>, <a href="https://pub.dev/packages/cryptography" rel="nofollow noreferrer">cryptography</a> but I couldn't relate anything to the code above.</p>
  <p>I did find a package <a href="https://pub.dev/packages/pointycastle" rel="nofollow noreferrer">pointycastle</a> that looked promising. Is this thing could be a similar to <code>crypto.subtle</code> ??</p>
  <p>Or
  Is it possible to get access to the brower's crypto.subtle object / API from Dart?</p>