public static WebAuthnResult AuthenticatorMakeCredential(IntPtr window, RelayingPartyInfo rp, UserInfo user, ICollection <CoseCredentialParameter> coseParams, ClientData clientData, AuthenticatorMakeCredentialOptions makeOptions, out CredentialAttestation credential) { //TODO: extensions credential = null; var rawUser = new RawUserInfo(user); var rawCredList = new RawCoseCredentialParameters(coseParams); var rawClientData = new RawClientData(clientData); var rawMakeCredOptions = makeOptions == null ? null : new RawAuthenticatorMakeCredentialOptions(makeOptions); var res = RawAuthenticatorMakeCredential(window, rp, rawUser, rawCredList, rawClientData, rawMakeCredOptions, out var rawCredPtr); if (rawCredPtr != IntPtr.Zero) { var rawCredObj = Marshal.PtrToStructure <RawCredentialAttestation>(rawCredPtr); credential = rawCredObj?.MarshalToPublic(); FreeRawCredentialAttestation(rawCredPtr); } rawUser.Dispose(); rawCredList.Dispose(); rawClientData.Dispose(); rawMakeCredOptions?.Dispose(); return(res); }
private static extern WebAuthnResult RawAuthenticatorMakeCredential( [In] IntPtr windowHandle, [In] RelayingPartyInfo rpInfo, [In] RawUserInfo rawUserInfo, [In] RawCoseCredentialParameters rawCoseCredParams, [In] RawClientData rawClientData, [In, Optional] RawAuthenticatorMakeCredentialOptions rawMakeCredentialOptions, [Out] out IntPtr rawCredentialAttestation);