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
userUserIdThe user the credential belongs to.
credentialIdGuidThe credential being rotated.
writtenPublicKeystringThe client's new public key as the operator supplied it.
cancellationTokenCancellationTokenCancels 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
usernames nobody,credentialIdis 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.