Add a credential to the Virtual Authenticator/ The credential to be stored in the Virtual Authenticator If is . If a Virtual Authenticator has not been added yet.
(Credential credential)
| 1062 | /// <exception cref="ArgumentNullException">If <paramref name="credential"/> is <see langword="null"/>.</exception> |
| 1063 | /// <exception cref="InvalidOperationException">If a Virtual Authenticator has not been added yet.</exception> |
| 1064 | public void AddCredential(Credential credential) |
| 1065 | { |
| 1066 | ArgumentNullException.ThrowIfNull(credential); |
| 1067 | |
| 1068 | string authenticatorId = this.AuthenticatorId ?? throw new InvalidOperationException("Virtual Authenticator needs to be added before it can perform operations"); |
| 1069 | |
| 1070 | Dictionary<string, object?> parameters = new Dictionary<string, object?>(credential.ToDictionary()); |
| 1071 | parameters.Add("authenticatorId", authenticatorId); |
| 1072 | |
| 1073 | this.Execute(driverCommandToExecute: DriverCommand.AddCredential, parameters); |
| 1074 | } |
| 1075 | |
| 1076 | /// <summary> |
| 1077 | /// Retrieves all the credentials stored in the Virtual Authenticator |