Class RemoteRsaSecurityKey
- Namespace
- NuvTools.Security.Signing
- Assembly
- NuvTools.Security.dll
An RSA key this process holds only the public half of. Creating a signature is handed to a delegate — typically a call to the vault or module that keeps the private half.
public class RemoteRsaSecurityKey : RsaSecurityKey
- Inheritance
-
RemoteRsaSecurityKey
- Inherited Members
Remarks
It is an RsaSecurityKey so that everything that publishes or verifies with the public parameters — a JWKS endpoint, a token validator — keeps working unchanged. Only the creation of a signature is redirected, through the key's own CryptoProviderFactory.
Signatures are RSASSA-PKCS1-v1_5 with SHA-256 (RS256); the delegate receives the data to
sign, not a digest, and returns the signature.
Constructors
RemoteRsaSecurityKey(RSAParameters, string, Func<byte[], byte[]>)
Creates the key.
public RemoteRsaSecurityKey(RSAParameters publicParameters, string keyId, Func<byte[], byte[]> sign)
Parameters
publicParametersRSAParametersThe modulus and exponent. Private parameters are not used.
keyIdstringThe identifier published with the key and written to every token.
signFunc<byte[], byte[]>Signs the given data with the private half and returns the signature.
Properties
PrivateKeyStatus
Reports that a private key exists — elsewhere. Reporting the truth about this process would make every consumer conclude the key cannot sign.
public override PrivateKeyStatus PrivateKeyStatus { get; }
Property Value
Methods
ToSigningCredentials()
The credentials to sign a token with this key.
public SigningCredentials ToSigningCredentials()