<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.18.0" />

Microsoft.IdentityModel.Tokens.AsymmetricSecurityKey

public abstract class AsymmetricSecurityKey : SecurityKey
Base class for a SecurityKey that contains Asymmetric key material.
public abstract bool HasPrivateKey { get; }

This must be overridden to get a bool indicating if a private key exists.

public abstract PrivateKeyStatus PrivateKeyStatus { get; }

Gets a value indicating the existence of the private key.

Initializes a new instance of the AsymmetricSecurityKey class.