# SecurityContext constructor

SecurityContext({bool withTrustedRoots: false })

Creates a new SecurityContext.

By default, the created SecurityContext contains no keys or certificates. These can be added by calling the methods of this class.

If `withTrustedRoots` is passed as `true`, the SecurityContext will be seeded by the trusted root certificates provided as explained below. To obtain a SecurityContext containing trusted root certificates, SecurityContext.defaultContext is usually sufficient, and should be used instead. However, if the SecurityContext containing the trusted root certificates must be modified per-connection, then `withTrustedRoots` should be used.

## Implementation

    external factory SecurityContext({bool withTrustedRoots: false});