Class ClientAssertionKeyMaterial
- Namespace
- MailFathom.Common.ClientAssertions
- Assembly
- MailFathom.Common.dll
Reads one half of a client's key pair out of the PEM an operator provisioned.
public static class ClientAssertionKeyMaterial
- Inheritance
-
ClientAssertionKeyMaterial
- Inherited Members
Remarks
Both halves are read here so that the deployment and the command refuse the same material for the same stated reason. The mistake this exists to catch is the one that would otherwise go unnoticed: a private key written where the public half belongs imports cleanly into every cryptographic API, so a deployment configured with one would start, verify signatures correctly, and hold the very credential the method exists to keep off the host.
The PEM label decides which half the material is, before anything is imported. That is what makes the refusal exact — the material is never partially interpreted first — and it is why an encrypted private key is reported as one rather than as material that failed to parse.
The caller owns what it receives and disposes it. Both readers return a live AsymmetricAlgorithm holding key state, so ownership has to transfer for the value to be usable at all.
Fields
- ShortestRsaModulusInBits
The shortest RSA modulus a signature is accepted from, in bits.
Methods
- ReadPrivateKey(ReadOnlySpan<char>, out ClientAssertionKeyFault)
Reads the private half a client signs an assertion with.
- ReadPublicKey(ReadOnlySpan<char>, out ClientAssertionKeyFault)
Reads the public half a deployment registers for one client.