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)
| 1120 | /// <exception cref="ArgumentNullException">If <paramref name="credential"/> is <see langword="null"/>.</exception> |
| 1121 | /// <exception cref="InvalidOperationException">If a Virtual Authenticator has not been added yet.</exception> |
| 1122 | public void AddCredential(Credential credential) |
| 1123 | { |
| 1124 | ArgumentNullException.ThrowIfNull(credential); |
| 1125 | |
| 1126 | string authenticatorId = this.AuthenticatorId ?? throw new InvalidOperationException("Virtual Authenticator needs to be added before it can perform operations"); |
| 1127 | |
| 1128 | Dictionary<string, object?> parameters = new Dictionary<string, object?>(credential.ToDictionary()); |
| 1129 | parameters.Add("authenticatorId", authenticatorId); |
| 1130 | |
| 1131 | this.Execute(driverCommandToExecute: DriverCommand.AddCredential, parameters); |
| 1132 | } |
| 1133 | |
| 1134 | /// <summary> |
| 1135 | /// Retrieves all the credentials stored in the Virtual Authenticator |