com.tmobile.oss.security.taap.poptoken.builder 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package com.tmobile.oss.security.taap.poptoken.builder --version 1.0.4                
NuGet\Install-Package com.tmobile.oss.security.taap.poptoken.builder -Version 1.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="com.tmobile.oss.security.taap.poptoken.builder" Version="1.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add com.tmobile.oss.security.taap.poptoken.builder --version 1.0.4                
#r "nuget: com.tmobile.oss.security.taap.poptoken.builder, 1.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install com.tmobile.oss.security.taap.poptoken.builder as a Cake Addin
#addin nuget:?package=com.tmobile.oss.security.taap.poptoken.builder&version=1.0.4

// Install com.tmobile.oss.security.taap.poptoken.builder as a Cake Tool
#tool nuget:?package=com.tmobile.oss.security.taap.poptoken.builder&version=1.0.4                

Proof Of Possession (PoP) Token Builder using .NET Standard 2.1

Implementation Details The T-Mobile Proof Of Possession (PoP) Token Builder component creates JWS tokens using the following logic: • Sets up the edts (external data to sign) and ehts (external headers to sign) claims in PoP token using the specified ehts key-value map. • The library uses SHA256 algorithm for calculating the edts • And then the final edts value is encoded using Base64 URL encoding. • Signs the PoP token using the specified RSA private key. • Creates the PoP token with 2 minutes of validity period. • Current PoP token builder libraries support RSA PKCS8 format key for signing and validating the PoP tokens.

Determining the ehts Key Name • For HTTP request URI, "uri" should be used as ehts key name, PopEhtsKeyEnum.Uri.GetDescription().
• For "uri" ehts value, the URI and query string of the request URL should be put in the ehts key-value map. Example: • If the URL is https://api.t-mobile.com/commerce/v1/orders?account-number=0000000000 then only /commerce/v1/orders?account-number=0000000000 should be used as ehts value. • The query parameter values part of "uri" ehts value should not be in URL encoded format. • For HTTP method, "http-method" should be used as ehts key name, PopEhtsKeyEnum.HttpMethod.GetDescription(). • For HTTP request headers, the header name should be used as ehts key name. • For HTTP request body, "body" should be used as ehts key name, PopEhtsKeyEnum.Body.GetDescription(). • For code sample, see test “PopTokenBuilder_Build_ValidPopToken_Success_Test”

Supported Key Format The PoP token builder library currently supports PKCS8 key format.

Using Non Encrypted Keys: Below commands shows how to create private and public keys in PKCS8 format:

# Create a 2048 bit Private RSA key in PKCS1 format
openssl genrsa -out private-key-pkcs1.pem 2048

# Convert the Private RSA key to PKCS8 format. 
openssl pkcs8 -topk8 -inform PEM -in private-key-pkcs1.pem -outform PEM -nocrypt -out private-key-pkcs8.pem

# Create a Public RSA key in PKCS8 format
openssl rsa -in private-key-pkcs8.pem -outform PEM -pubout -out public-key.pem

**C# Code Example ** https://github.com/cprothm1/tmobile-api-security-lib/blob/master/poptoken-lib/poptoken-builder/cs-lib-tmobile-oss-poptoken-builder/poptoken.builder.test/PopTokenBuilder.UnitTest.cs

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on com.tmobile.oss.security.taap.poptoken.builder:

Package Downloads
com.tmobile.oss.security.taap.jwe

This component is for field level encryption. It will encrypt your PII data as a JWE token using a public RSA RS256 or EC P-256 key.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.10 64,985 9/9/2021
1.0.4 1,318 3/16/2021

Updated component to use .NET Standzard 2.1.
Updated Microsoft.IdentityModel.JasonWebTokens component to 6.9.0.
Updated Builder to accept PEM or XML Key format.