title: Read a PEM file with Flutter API encrypt
body: <pre><code>import 'package:encrypt/encrypt.dart';
  import 'package:encrypt/encrypt_io.dart';
  import 'dart:io';
  import 'package:pointycastle/asymmetric/api.dart';
  import 'dart:async';
  import 'package:flutter/services.dart' show rootBundle;
  
  class Encrypt {
    Future&lt;String&gt; loadPrivateKey() async {
      return await rootBundle.loadString('assets/private_key.pem');
    }
  
    Future&lt;String&gt; loadPublicKey() async {
      return await rootBundle.loadString('assets/public_key.pem');
    }
  
    encryptString() async {
      print(loadPublicKey().toString());
      final publicKey =
          await parseKeyFromFile&lt;RSAPublicKey&gt;('${loadPublicKey()}');
      final privateKey =
          await parseKeyFromFile&lt;RSAPrivateKey&gt;('${loadPrivateKey()}');
  
      final plainText = 'James Bond';
      final encrypter =
          Encrypter(RSA(publicKey: publicKey, privateKey: privateKey));
  
      final encrypted = encrypter.encrypt(plainText);
      final decrypted = encrypter.decrypt(encrypted);
  
      print(decrypted);
      print(encrypted.base64);
    }
  }
  </code></pre>
  
  <p>ERROR:
  Performing hot reload...
  Syncing files to device AOSP on IA Emulator...
  Reloaded 8 of 707 libraries in 1,021ms.
  I/flutter ( 7395): Instance of 'Future'
  E/flutter ( 7395): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot open file, path = 'Instance of 'Future'' (OS Error: No such file or directory, errno = 2)</p>
  
  <p>I did add assets in yaml file as:   </p>
  
  <pre><code>flutter:
    assets:
      - assets/
  </code></pre>