Skip to content

Commit 4b413c4

Browse files
committed
tests: add Microsoft.Bcl.Cryptography package reference and update certificate loading method
1 parent 3dd3c82 commit 4b413c4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Yubico.YubiKey/tests/utilities/Yubico.YubiKey.TestUtilities.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ limitations under the License. -->
3131
</PropertyGroup>
3232

3333
<ItemGroup>
34+
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="9.0.2" />
3435
<PackageReference Include="Moq" Version="4.16.1" />
3536
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
3637
</ItemGroup>

Yubico.YubiKey/tests/utilities/Yubico/YubiKey/TestUtilities/TestKeys.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ namespace Yubico.YubiKey.TestUtilities
1414
/// </summary>
1515
public abstract class TestCrypto
1616
{
17+
/// <summary>
18+
/// The raw byte representation of the cryptographic data in DER format.
19+
/// </summary>
1720
protected readonly byte[] _bytes;
1821
protected readonly string _pemStringFull;
1922

@@ -164,7 +167,7 @@ private TestCertificate(string filePath, bool isAttestation) : base(filePath)
164167
/// <returns>X509Certificate2 instance initialized with the certificate data</returns>
165168
public X509Certificate2 AsX509Certificate2()
166169
{
167-
return new X509Certificate2(_bytes);
170+
return X509CertificateLoader.LoadCertificate(_bytes);
168171
}
169172

170173
/// <summary>

0 commit comments

Comments
 (0)