SecurityDataParsers.SubjectAlternativeName
1.0.2
See the version list below for details.
dotnet add package SecurityDataParsers.SubjectAlternativeName --version 1.0.2
NuGet\Install-Package SecurityDataParsers.SubjectAlternativeName -Version 1.0.2
<PackageReference Include="SecurityDataParsers.SubjectAlternativeName" Version="1.0.2" />
paket add SecurityDataParsers.SubjectAlternativeName --version 1.0.2
#r "nuget: SecurityDataParsers.SubjectAlternativeName, 1.0.2"
// Install SecurityDataParsers.SubjectAlternativeName as a Cake Addin #addin nuget:?package=SecurityDataParsers.SubjectAlternativeName&version=1.0.2 // Install SecurityDataParsers.SubjectAlternativeName as a Cake Tool #tool nuget:?package=SecurityDataParsers.SubjectAlternativeName&version=1.0.2
SubjectAlternativeName
A class for digging into all the possible extension data that can be on a certificate.
Some of the more obscure ones are:
- Federal Agency Smart Credential Number (FASC-N)
- X400 Address
- Edi Party Name
See the IETF Specification for more information
Installation
Install the package with NuGet
Install-Package SecurityDataParsers.SubjectAlternativeName
Or via the .NET Core command line interface:
dotnet add package SecurityDataParsers.SubjectAlternativeName
Either commands, from Package Manager Console or .NET Core CLI, will download and install the package.
Usage
using SecurityDataParsers.SubjectAlternativeName;
// Load the certificate you want get data from
var cert = new X509Certificate2("path/to/certificate.pfx", "password");
// Get the SAN extension
var sanExtension = cert.Extensions["2.5.29.17"];
// Parse the SAN extension
var san = new SAN(sanExtension);
// Or let the SAN class extract it itself
var san = new SAN(cert);
// Destructure the SAN extension to get its properties
var (
fASCN,
principalName,
rfc822Name,
dnsName,
x400Address,
directoryName,
ediPartyName,
uniformResourceIdentifier,
iPAddress,
registeredID
) = san.First;
// Use the properties as needed
Console.WriteLine($"FASCN: {fASCN.personIdentifier}");
Console.WriteLine($"Principal Name: {principalName}");
// If it contains multiples, the base class contains lists you can check.
san.dnsNames.Select(v => Console.WrtitLine(v.Host))
API
See the API docs: docs/README.md
Changelog
Take a look at the CHANGELOG.md.
Contribution
You're free to contribute to this project by submitting issues and/or pull requests.
Please keep in mind that every change and feature should be covered by tests.
License
This project is licensed under MIT.
Contributors
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- BouncyCastle.Cryptography (>= 2.2.1)
- SecurityDataParsers.FederalAgencySmartCredentialNumber (>= 1.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
CHANGELOG.md