コード例 #1
0
        /// <summary>
        /// Create and initialize an API Context.
        /// </summary>
        public static ApiContext Create(ApiEnvironmentType environmentType, string apiKey, string deviceDescription,
                                        List <string> permittedIps, string proxy = null)
        {
            var apiContext = new ApiContext
            {
                ApiKey          = apiKey,
                EnvironmentType = environmentType,
                Proxy           = proxy,
            };

            apiContext.Initialize(deviceDescription, permittedIps);

            return(apiContext);
        }
コード例 #2
0
        /// <summary>
        /// Create and initialize an API Context.
        /// </summary>
        public static ApiContext CreateForPsd2(ApiEnvironmentType environmentType, X509Certificate2 publicCertificate,
                                               X509CertificateCollection certificateChain, string deviceDescription, List <string> permittedIps,
                                               string proxy = null)
        {
            var apiContext = new ApiContext
            {
                EnvironmentType = environmentType,
                Proxy           = proxy,
            };

            apiContext.InitializeInstallationContext();
            apiContext.ApiKey = apiContext.InitializePsd2Credential(publicCertificate, certificateChain);
            apiContext.RegisterDevice(deviceDescription, permittedIps);
            apiContext.InitializeSessionContext();

            return(apiContext);
        }
コード例 #3
0
 /// <summary>
 /// Create and initialize an API Context with current IP as permitted.
 /// </summary>
 public static ApiContext Create(ApiEnvironmentType environmentType, string apiKey, string deviceDescription,
                                 string proxy = null)
 {
     return(Create(environmentType, apiKey, deviceDescription, new List <string>(), proxy));
 }