Beispiel #1
0
        public APIConnector(string apiIdentity, string secret, string apiUrl, PublicKeyStore publicKeyStore)
        {
            this.apiIdentity = apiIdentity;
            this.secret      = secret;
            this.apiUrl      = apiUrl;

            if (publicKeyStore != null)
            {
                this.publicKeyStore = publicKeyStore;
            }
            else
            {
                this.publicKeyStore = this.GetSQLiteDbProvider();
            }
        }
Beispiel #2
0
        private PublicKeyStore GetSQLiteDbProvider()
        {
            PublicKeyStore store = null;

            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
            IConfigurationRoot configuration    = builder.Build();
            string             connectionString = configuration.GetConnectionString("SQLiteConnectionString");

            if (!String.IsNullOrWhiteSpace(connectionString))
            {
                store = new PublicKeyStoreDb(connectionString);
            }
            else
            {
                store = new PublicKeyStoreNone();
            }

            return(store);
        }
Beispiel #3
0
 public APIConnector(string apiIdentity, string secret, PublicKeyStore publicKeyStore) :
     this(apiIdentity, secret, APIConnector.DEFAULTAPIURL, publicKeyStore)
 {
 }