© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
64 replies
tftviking

❔ Load Certificate from Azure Key Vault as memorystream

I have a code that works perfect when testing it local and set my certificates as paths.
When uploading it on Azure it do not work to use the path. My guess is that I have to upload the certificates on Key Vault and call the certificates from there.
I'm using .NET Core Web App

In the Nugget from Swish you can enter the certificate as direct path or as a stream.
Do anyone have a solution how to fix this?

var clientCertificate = new SwishApi.Models.ClientCertificate()
{
    CertificateFilePath = "Cert//Swish_Merchant_TestCertificate_1234679304.pfx",
    Password = "swish"
};

string certificatePath = Environment.CurrentDirectory + "\\Cert\\Swish_Merchant_TestSigningCertificate_1234679304.pfx";
var payoutClient = new SwishApi.PayoutClient(clientCertificate, "https://eofvqci6optquip.m.pipedream.net", "1234", "1234679304", true, SwishApi.Environment.Emulator);

string instructionUUID = Guid.NewGuid().ToString("N").ToUpper();

// Anropa MakePayoutRequest med formulärvärden.
var response = payoutClient.MakePayoutRequest(PayoutTo, Personnummer, Amount, Message, instructionUUID, "7d70445ec8ef4d1e3a713427e973d097", new SwishApi.Models.ClientCertificate() { CertificateFilePath = certificatePath, Password = "swish" });
var clientCertificate = new SwishApi.Models.ClientCertificate()
{
    CertificateFilePath = "Cert//Swish_Merchant_TestCertificate_1234679304.pfx",
    Password = "swish"
};

string certificatePath = Environment.CurrentDirectory + "\\Cert\\Swish_Merchant_TestSigningCertificate_1234679304.pfx";
var payoutClient = new SwishApi.PayoutClient(clientCertificate, "https://eofvqci6optquip.m.pipedream.net", "1234", "1234679304", true, SwishApi.Environment.Emulator);

string instructionUUID = Guid.NewGuid().ToString("N").ToUpper();

// Anropa MakePayoutRequest med formulärvärden.
var response = payoutClient.MakePayoutRequest(PayoutTo, Personnummer, Amount, Message, instructionUUID, "7d70445ec8ef4d1e3a713427e973d097", new SwishApi.Models.ClientCertificate() { CertificateFilePath = certificatePath, Password = "swish" });


Have a look at this files :

https://github.com/RickardPettersson/swish-api-csharp/blob/master/SwishApi/Models/ClientCertificate.cs
https://github.com/RickardPettersson/swish-api-csharp/blob/master/SwishApi/PayoutClient.cs

https://github.com/RickardPettersson/swish-api-csharp/issues/23
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ Azure key vault with microservices
C#CC# / help
2y ago
❔ Azure Key Vault for local development
C#CC# / help
4y ago
Azure Key Vault (RBAC) and Local Developers?
C#CC# / help
2y ago
❔ How to connect to Azure Key Vault from external VPS?
C#CC# / help
4y ago