Table of Contents

Method ReplacePublicKeyAsync

Namespace
MailFathom.Application.Access.Credentials
Assembly
MailFathom.Application.dll

ReplacePublicKeyAsync(UserId, Guid, string?, CancellationToken)

Replaces the public key one credential verifies assertions against.

public Task<UserCredentialRotation> ReplacePublicKeyAsync(UserId user, Guid credentialId, string? writtenPublicKey, CancellationToken cancellationToken)

Parameters

user UserId

The user the credential belongs to.

credentialId Guid

The credential being rotated.

writtenPublicKey string

The client's new public key as the operator supplied it.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<UserCredentialRotation>

What the act did, and the fingerprint the client's assertions must name from now on.

Exceptions

ArgumentException

Thrown when user names nobody, credentialId is the empty identifier, or the written key is not one this deployment accepts.

PrincipalNotAuthorizedException

Thrown when the caller holds AdminCredentialsWrite at no scope, does not hold a name the user holds widely enough, or is not the root while the user holds a role listing a pattern.