W3cubDocs

/Dart 2

useCertificateChain method

void useCertificateChain (String file, { String password })

Sets the chain of X509 certificates served by SecureServerSocket when making secure connections, including the server certificate.

file is a PEM or PKCS12 file containing X509 certificates, starting with the root authority and intermediate authorities forming the signed chain to the server certificate, and ending with the server certificate. The private key for the server certificate is set by usePrivateKey. For PKCS12 files, password is the password for the file. For PEM files, password is ignored. Assuming it is well-formatted, all other contents of file are ignored.

NB: This function calls File.readAsBytesSync, and will block on file IO. Prefer using useCertificateChainBytes.

iOS note: As noted above, usePrivateKey does the job of both that call and this one. On iOS, this call is a no-op.

Implementation

void useCertificateChain(String file, {String password});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-io/SecurityContext/useCertificateChain.html