public ValuesController() { _jwtSecurityTokenHandler = new JwtSecurityTokenHandler(); _tokenCreator = new TokenCreator(); _certificateReader = new CertificateReader(); _tokenValidator = new TokenValidator(_jwtSecurityTokenHandler, _certificateReader); }
public static void FromSecrets() { const string organizationNumber = "123456789"; var clientConfiguration = new ClientConfiguration( Environment.DifiTest, CertificateReader.ReadCertificate(), new Sender(organizationNumber)); }
public HttpResponseMessage ReadCertificate(string filename, string password) { _certificateReader = new CertificateReader(); filename = Path.Combine(_certStoreBasePath, filename); _certificateReader.SetPrivateKeyFromP12(filename, password); CertificateInfo certificateInfo = GetCertificateInfo(); return(Request.CreateResponse(HttpStatusCode.OK, certificateInfo, new JsonMediaTypeFormatter())); }
public void ClientConfigurationWithCertificate() { // The actual sender of the message. The broker is the owner of the organization certificate // used in the library. The broker id can be retrieved from your Digipost organization account. var broker = new Broker(12345); // The sender is what the receiver of the message sees as the sender of the message. // Sender and broker id will both be your organization's id if you are sending on behalf of yourself. var sender = new Sender(67890); var clientConfig = new ClientConfig(broker, Environment.Production); var client = new DigipostClient(clientConfig, CertificateReader.ReadCertificate()); }
public static TestSender GetSender(TestEnvironment testEnvironment) { switch (testEnvironment) { case TestEnvironment.DifiTest: return(new TestSender( 497013, CertificateResource.Certificate(), Environment.DifiTest, new RecipientById(IdentificationType.DigipostAddress, "ReplaceMehere") )); case TestEnvironment.Qa: return(new TestSender( 1185201, CertificateReader.ReadCertificate(), Environment.Qa, new RecipientById(IdentificationType.DigipostAddress, "liv.test.aliassen#8514") )); default: throw new ArgumentOutOfRangeException(nameof(testEnvironment), testEnvironment, null); } }
public static X509Certificate2 GetBringCertificate() { var serviceProvider = LoggingUtility.CreateServiceProviderAndSetUpLogging(); return(CertificateReader.ReadCertificate(serviceProvider.GetService <ILoggerFactory>())); }
public OnBehalfTokenGenerator() { this._certReader = new CertificateReader(); }
public S2STokenGenerator() { this._certReader = new CertificateReader(); }