Skip to content

Commit 0a41db9

Browse files
elinohlssonElin Fokine
andauthored
Change default client certificate format from PFX to P12. (#539)
* Change default client certificate format from PFX to P12. * Update documentation about default client certificate for test. * Update breaking changes with info about changed default file format for client certificate. --------- Co-authored-by: Elin Fokine <ElinO@activesolution.se>
1 parent f95e1ff commit 0a41db9

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

BREAKINGCHANGES.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,19 @@ If you are upgrading from an earlier version, you must update any application or
3434

3535
When loading embedded BankID certificates (client test certificate and root certificates for both test and production), we now use `X509KeyStorageFlags.DefaultKeySet` by default.
3636

37-
If this change causes issues in your environment, you can override the `X509KeyStorageFlags` used for the client test certificate. See [the documention](https://docs.activelogin.net/articles/bankid.html#test-environment) for information about how it is done.
37+
If this change causes issues in your environment, you can override the `X509KeyStorageFlags` used for the client test certificate. See [the documentation](https://docs.activelogin.net/articles/bankid.html#test-environment) for information about how it is done.
3838

3939
### Loading client BankID certificate from Azure Key Vault
4040

4141
When loading the client BankID certificate from Azure Key Vault, we now use `X509KeyStorageFlags.DefaultKeySet` by default.
4242

43-
If this causes issues in your environment, it is possible to override the `X509KeyStorageFlags` used when loading the certificate. See [the documention](https://docs.activelogin.net/articles/bankid.html#using-client-certificate-from-azure-keyvault) for information about how it is done.
43+
If this causes issues in your environment, it is possible to override the `X509KeyStorageFlags` used when loading the certificate. See [the documentation](https://docs.activelogin.net/articles/bankid.html#using-client-certificate-from-azure-keyvault) for information about how it is done.
44+
45+
### Format of client BankID certificate
46+
47+
The default file format for the client BankID certificate in the test environment has changed. Instead of `FPTestcert5_20240610-legacy.pfx`, the default is now `FPTestcert5_20240610.p12`.
48+
49+
This can be overridden if required. See the [documentation](https://docs.activelogin.net/articles/bankid.html#specify-client-certificate-format) for further information.
4450

4551
---
4652

@@ -353,7 +359,7 @@ When implementing the animated QR code, we have had to update the client side sc
353359

354360
### Use DefaultAzureCredentials when accessing KeyVault
355361

356-
If using Azure KeyVault for your certificate, we have made chamges to how you authenticate/access that. See [the documention](https://docs.activelogin.net/articles/bankid.html#keyvault-credentials) for how it should be configured now.
362+
If using Azure KeyVault for your certificate, we have made chamges to how you authenticate/access that. See [the documentation](https://docs.activelogin.net/articles/bankid.html#keyvault-credentials) for how it should be configured now.
357363

358364
### Drop support for GrandID
359365

docs/articles/bankid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ services
236236

237237
#### Specify client certificate format
238238

239-
BankId provides the client certificate for the test environment in three different versions FPTestcert5_20240610.p12, FPTestcert5_20240610.pem and FPTestcert5_20240610-legacy.pfx. Use `FPTestcert5_20240610.p12` for newer applications and environments that support modern encryption methods. Use `FPTestcert5_20240610.pem` if your application requires PEM format. Use `FPTestcert5_20240610-legacy.pfx ` for older applications requiring older algorithms such as Windows Server earlier versions than 2022. The format of the client certificate can be configured. By default `FPTestcert5_20240610-legacy.pfx `is used.
239+
BankId provides the client certificate for the test environment in three different versions FPTestcert5_20240610.p12, FPTestcert5_20240610.pem and FPTestcert5_20240610-legacy.pfx. Use `FPTestcert5_20240610.p12` for newer applications and environments that support modern encryption methods. Use `FPTestcert5_20240610.pem` if your application requires PEM format. Use `FPTestcert5_20240610-legacy.pfx` for older applications requiring older algorithms such as Windows Server earlier versions than 2022. The format of the client certificate can be configured. By default `FPTestcert5_20240610-legacy.p12 `is used.
240240

241241
```csharp
242242
services

src/ActiveLogin.Authentication.BankId.Core/BankIdCertificates.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static class BankIdCertificates
2222
TestCertificateFormat.P12 => GetCertFromResourceStream(BankIdApiClientCertificateTestP12, keyStorageFlags),
2323
TestCertificateFormat.PEM => GetPemCertFromResourceStream(BankIdApiClientCertificateTestPem),
2424
TestCertificateFormat.PFX => GetCertFromResourceStream(BankIdApiClientCertificateTestPfx, keyStorageFlags),
25-
_ => GetCertFromResourceStream(BankIdApiClientCertificateTestPfx, keyStorageFlags)
25+
_ => GetCertFromResourceStream(BankIdApiClientCertificateTestP12, keyStorageFlags)
2626
};
2727

2828
private static X509Certificate2 GetCertFromResourceStream(CertificateResource resource, X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet)

src/ActiveLogin.Authentication.BankId.Core/IBankIdBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public static IBankIdBuilder UseTestEnvironment(
217217
this IBankIdBuilder builder,
218218
bool useBankIdRootCertificate = true,
219219
bool useBankIdClientCertificate = true,
220-
TestCertificateFormat clientCertificateFormat = TestCertificateFormat.PFX,
220+
TestCertificateFormat clientCertificateFormat = TestCertificateFormat.P12,
221221
X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet
222222
)
223223
{

0 commit comments

Comments
 (0)