PlatformCertificate.Proto
2.0.3
dotnet add package PlatformCertificate.Proto --version 2.0.3
NuGet\Install-Package PlatformCertificate.Proto -Version 2.0.3
<PackageReference Include="PlatformCertificate.Proto" Version="2.0.3" />
paket add PlatformCertificate.Proto --version 2.0.3
#r "nuget: PlatformCertificate.Proto, 2.0.3"
// Install PlatformCertificate.Proto as a Cake Addin #addin nuget:?package=PlatformCertificate.Proto&version=2.0.3 // Install PlatformCertificate.Proto as a Cake Tool #tool nuget:?package=PlatformCertificate.Proto&version=2.0.3
This lightweight library attempts to capture sequences from the TCG Platform Certificate 2.0 Information Model into Google's Protobuf format. Those protobuf messages are compiled as C# Objects and made available by referencing this package in a project.
The library is available via Nuget https://www.nuget.org/packages/PlatformCertificate.Proto for inclusion into .NET projects.
The proto source files are available on GitHub and can be compiled into any language supported by Protobuf.
They are also available in a follow-on Nuget package: https://www.nuget.org/packages/PlatformCertificate.Proto.ProtoFiles. This ProtoFiles package will allow others to import the original protobuf files into subsequent projects.
Usage
Reference this library in your .NET project. Then you can use the objects.
using PlatformCertificateFromProto;
namespace YourNamespace {
public class YourClass {
public void YourMethod {
ComponentIdentifierTrait trait = new();
...
trait.ToString(); // Each object can be serialized to JSON
}
}
}
Read information from a JSON file:
using PlatformCertificateFromProto;
namespace YourNamespace {
public class YourClass {
public void YourMethod {
string json = File.ReadAllText(PLATFORMATTRIBUTECERTIFICATE_A1_TRAITS_PATH);
PlatformAttributeCertificate result = PlatformAttributeCertificate.Parser.WithDiscardUnknownFields(true).ParseJson(json);
...
}
}
}
Oids.proto is a reference for many Oids, and the full OID can be queried and returned as a string.
using OidsProto;
using PlatformCertificateFromProto;
namespace YourNamespace {
public class YourClass {
public void YourMethod {
ObjectIdentifier oid = OidsUtils.Find(TCG_TR_ID_NODE.TcgTrIdBoolean); // oid.Oid = 2.23.133.19.1.1
}
}
}
Compile
The .NET project should compile the C# files from the proto files on every build and pack them into a nuget package.
Useful Links
https://trustedcomputinggroup.org/resource/tcg-platform-certificate-profile/
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
-
net6.0
- Google.Protobuf (>= 3.20.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on PlatformCertificate.Proto:
Package | Downloads |
---|---|
paccor.paccor_scripts
Package Description |
|
paccor.HardwareManifestPlugin
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.