public void GetAssert(FidoAssertion assert, SecureString pin) { IntPtr pinPtr = IntPtr.Zero; try { if (pin.Length > 0) { pinPtr = Marshal.SecureStringToCoTaskMemAnsi(pin); } Native.fido_dev_get_assert(_native, (fido_assert_t *)assert, pinPtr).Check(); } finally { if (pinPtr != IntPtr.Zero) { Marshal.ZeroFreeCoTaskMemAnsi(pinPtr); } } }
/// <summary> /// Uses the device to generate an assertion /// </summary> /// <param name="assert">The assertion object with its input properties properly set</param> /// <param name="pin">The pin set on the device, if applicable</param> /// <exception cref="CtapException">Thrown if an error occurs while generating the assertion</exception> public void GetAssert(FidoAssertion assert, string pin) => Native.fido_dev_get_assert(_native, (fido_assert_t *)assert, pin).Check();