-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to work around some multi-targeting issues
- Loading branch information
Showing
18 changed files
with
170 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/FluentCertificates.Common/FluentCertificates.Common.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>latest</LangVersion> | ||
<CheckEolTargetFramework>false</CheckEolTargetFramework> | ||
<IsPackable>true</IsPackable> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<RootNamespace>FluentCertificates</RootNamespace> | ||
|
||
<Authors>Michael Monsour</Authors> | ||
<Copyright>Copyright © Michael Monsour 2022</Copyright> | ||
<Description>FluentCertificates.Common is part of the FluentCertificates package. This library provides common classes and functionality shared with the other FluentCertificates packages.</Description> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageTags>certificate;certs;fluent;x509;pfx;pem;cert;crt;CA</PackageTags> | ||
<PackageProjectUrl>https://github.com/lethek/FluentCertificates</PackageProjectUrl> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<RepositoryUrl>https://github.com/lethek/FluentCertificates</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="FluentCertificates.Builder" /> | ||
<InternalsVisibleTo Include="FluentCertificates.Builder.Tests" /> | ||
<InternalsVisibleTo Include="FluentCertificates.Extensions" /> | ||
<InternalsVisibleTo Include="FluentCertificates.Extensions.Tests" /> | ||
<InternalsVisibleTo Include="FluentCertificates.Finder" /> | ||
</ItemGroup> | ||
|
||
<Choose> | ||
<When Condition="'$(TargetFramework)' == 'net8.0'"> | ||
<ItemGroup> | ||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.1" /> | ||
</ItemGroup> | ||
</When> | ||
<Otherwise> | ||
<ItemGroup> | ||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.0" /> | ||
</ItemGroup> | ||
</Otherwise> | ||
</Choose> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\README.md" Pack="true" Visible="false" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Security.Cryptography.X509Certificates; | ||
|
||
namespace FluentCertificates.Internals; | ||
|
||
#pragma warning disable SYSLIB0057 | ||
internal static class Tools | ||
{ | ||
internal static X509Certificate2 LoadCertificate(ReadOnlySpan<byte> data) | ||
{ | ||
// #if NET9_0_OR_GREATER | ||
// return X509CertificateLoader.LoadCertificate(data); | ||
// #else | ||
return new X509Certificate2(data); | ||
//#endif | ||
} | ||
|
||
|
||
internal static X509Certificate2 LoadCertificateFromFile(string path) | ||
{ | ||
// #if NET19_0_OR_GREATER | ||
// return X509CertificateLoader.LoadCertificateFromFile(path); | ||
// #else | ||
return new X509Certificate2(path); | ||
// #endif | ||
} | ||
|
||
|
||
internal static X509Certificate2 LoadPkcs12( | ||
ReadOnlySpan<byte> data, | ||
string? password, | ||
X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet) | ||
{ | ||
// #if NET9_0_OR_GREATER | ||
// return X509CertificateLoader.LoadPkcs12(data, password, keyStorageFlags); | ||
// #else | ||
return new X509Certificate2(data, password, keyStorageFlags); | ||
// #endif | ||
} | ||
|
||
|
||
internal static X509Certificate2 LoadPkcs12FromFile( | ||
string path, | ||
string? password, | ||
X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet) | ||
{ | ||
// #if NET9_0_OR_GREATER | ||
// return X509CertificateLoader.LoadPkcs12FromFile(path, password, keyStorageFlags); | ||
// #else | ||
return new X509Certificate2(path, password, keyStorageFlags); | ||
// #endif | ||
} | ||
} | ||
#pragma warning restore SYSLIB0057 |
5 changes: 3 additions & 2 deletions
5
...Certificates.Extensions/Internals/Oids.cs → src/FluentCertificates.Common/Oids.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.