Пример #1
0
        public static TlsContextOptions ServerPkcs12FromPath(string pkcs12Path, string pkcs12Password)
        {
            TlsContextOptions options = new TlsContextOptions();

            options.InitServerPkcs12FromPath(pkcs12Path, pkcs12Password);
            return(options);
        }
Пример #2
0
        public static TlsContextOptions DefaultServerFromPath(string certPath, string privateKeyPath)
        {
            TlsContextOptions options = new TlsContextOptions();

            options.InitDefaultServerFromPath(certPath, privateKeyPath);
            return(options);
        }
Пример #3
0
        public static TlsContextOptions ClientMtlsFromPath(string certPath, string privateKeyPath)
        {
            TlsContextOptions options = new TlsContextOptions();

            options.InitClientMTlsFromPath(certPath, privateKeyPath);
            return(options);
        }
Пример #4
0
 public ServerTlsContext(TlsContextOptions options)
 {
     NativeHandle = API.make_new_server(
         (Int32)options.MinimumTlsVersion,
         options.caFile,
         options.caPath,
         options.AlpnList,
         options.certificatePath,
         options.privateKeyPath,
         options.pkcs12Path,
         options.pkcs12Password,
         options.MaxFragmentSize,
         (byte)(options.VerifyPeer ? 1 : 0));
 }
Пример #5
0
        public static TlsContextOptions DefaultClient()
        {
            TlsContextOptions options = new TlsContextOptions();

            return(options);
        }