Exemplo n.º 1
0
 /// <summary>
 /// Creates an instance of a Token SDK.
 /// </summary>
 /// <param name="channel">the gRPC channel</param>
 /// <param name="cryptoEngineFactory">the crypto factory to create crypto engine</param>
 /// <param name="tokenCluster">the token cluster to connect to</param>
 public TokenClient(
     ManagedChannel channel,
     ICryptoEngineFactory cryptoEngineFactory,
     TokenCluster tokenCluster)
     : base(channel, cryptoEngineFactory, tokenCluster)
 {
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of a Token SDK.
 /// </summary>
 /// <param name = "channel">GRPC channel</param>
 /// <param name="cryptoEngineFactory">crypto factory instance</param>
 /// <param name="tokenCluster">token cluster</param>
 /// <param name="browserFactory">browser factory</param>
 public TokenClient(
     ManagedChannel channel,
     ICryptoEngineFactory cryptoEngineFactory,
     TokenCluster tokenCluster, IBrowserFactory browserFactory) : base(channel, cryptoEngineFactory, tokenCluster)
 {
     this.browserFactory = browserFactory;
 }
Exemplo n.º 3
0
            /// <summary>
            /// Creates new builder instance with the defaults initialized.
            /// </summary>
            /// <returns></returns>
            public new TokenClient Build()
            {
                var metadata   = GetHeaders();
                var newChannel = ManagedChannel.NewBuilder(hostName, port, useSsl)
                                 .WithTimeout(timeoutMs)
                                 .WithMetadata(metadata)
                                 .UseKeepAlive(keepAlive)
                                 .WithKeepAliveTime(keepAliveTimeMs)
                                 .Build();

                return(new TokenClient(
                           newChannel,
                           cryptoEngine ?? new TokenCryptoEngineFactory(new InMemoryKeyStore()),
                           tokenCluster ?? TokenCluster.SANDBOX));
            }