using System.Runtime.InteropServices; using ProtonVPN.OperatingSystems.WebAuthn.Interop.Marshalers; using ProtonVPN.OperatingSystems.WebAuthn.Interop.StructVersions; namespace ProtonVPN.OperatingSystems.WebAuthn.Interop.Structs; /// /// Information about credential. /// /// Corresponds to WEBAUTHN_CREDENTIAL. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class CredentialIn : IDisposable { /// /// Version of this structure, to allow for modifications in the future. /// private protected CredentialVersion Version = CredentialVersion.Current; private int _idLength; /// /// Unique ID for this particular credential. /// private ByteArrayIn _id; /// /// Well-known credential type specifying what this particular credential is. /// private string _type; public CredentialIn(byte[] id, string type) { _id = new ByteArrayIn(id); _idLength = id?.Length ?? 0; _type = type; } public void Dispose() { _id?.Dispose(); _id = null; } }