I am working to develop a limited pin change and pin reset tool that we can distribute organization wide. We only want to allow them to change their pin or reset it. If anyone knows where documentation on this dll, or the libyubikey-0.dll I would really appreciate a link to it.
I have completed the reset process using references to libykpiv-1.dll. I cannot get the ykPIV_verify to work properly. I believe the byte that I am passing containing the current pin is not formatted correctly. I am using the following code:
public bool VerifyPin(string CurrPin, out int triesLeft) { try { byte[] bytePin = Encoding.ASCII.GetBytes(CurrPin); triesLeft = 0; YubicoPivReturnCode code = SafeNativeMethods.YkPivVerifyPin(_state, bytePin, ref triesLeft); if (code != YubicoPivReturnCode.YKPIV_OK) { return false; } return true; } catch (Exception ex) { Console.WriteLine(ex.Message); triesLeft = 0; return false; } }
Can anyone help me out with this?
|