behzad soltani
2 min readJul 1, 2021

--

Future<SecurityContext> get globalContext async {
final List<int> keyBytes =
(await rootBundle.load(‘assets/resources/key.key’))
.buffer
.asInt8List();
final List<int> certificateChainBytes =
(await rootBundle.load(‘assets/resources/key_crt.crt’))
.buffer
.asInt8List();
SecurityContext sc = SecurityContext(withTrustedRoots: false);
sc.usePrivateKeyBytes(keyBytes);
sc.useCertificateChainBytes(certificateChainBytes);
return sc;
}

--

--

behzad soltani
0 Followers

a Flutter and Laravel Developer