/// <summary> /// Post warnings according to the results of credential operations. /// </summary> /// <param name="verif">Status of credential operation result to post.</param> internal static void WinHelloErrors(KeyCredentialStatus verif, string initialString) { switch (verif) { case (KeyCredentialStatus.CredentialAlreadyExists): MessageService.ShowWarning(initialString + "The credential already exists."); break; case (KeyCredentialStatus.NotFound): MessageService.ShowWarning(initialString + "The credential could not be found."); break; case (KeyCredentialStatus.SecurityDeviceLocked): MessageService.ShowWarning(initialString + "The security device was locked."); break; case (KeyCredentialStatus.UnknownError): MessageService.ShowWarning(initialString + "An unknown error occurred."); break; case (KeyCredentialStatus.UserCanceled): MessageService.ShowWarning(initialString + "The request was cancelled by the user."); break; case (KeyCredentialStatus.UserPrefersPassword): MessageService.ShowWarning(initialString + "The user prefers to enter a password."); break; default: MessageService.ShowWarning(initialString + "An Error prevented Windows Hello from completing the operation."); break; } }
static int CredentialStatusToExitCode(KeyCredentialStatus status) { return(171 + (int)status); // Avoid reserved exit codes of UNIX }