Table of Contents

Class VpnProfile

Namespace
VpnHood.AppLib.App.VpnProfiles
Assembly
VpnHood.AppLib.App.dll

Represents a VPN profile as the storage keeps it: an access key the app connects with, and what the person chose for it.

public class VpnProfile
Inheritance
VpnProfile
Inherited Members
Extension Methods

Properties

AccessCode

Gets or sets the premium code the profile connects with, or null for none.

public string? AccessCode { get; set; }

Property Value

string

AccessCodeRefusal

Gets or sets the server's refusal of the premium code, or null for none.

public AccessCodeRefusal? AccessCodeRefusal { get; set; }

Property Value

AccessCodeRefusal

CustomData

Gets or sets the text a UI keeps with the profile, which the app does not read, or null.

public string? CustomData { get; set; }

Property Value

string

CustomServerEndpoints

Gets or sets the server's addresses the person gave, or null for none.

[JsonConverter(typeof(ArrayConverter<IPEndPoint, IPEndPointConverter>))]
public IPEndPoint[]? CustomServerEndpoints { get; set; }

Property Value

IPEndPoint[]

IsAccessCodeSynced

Gets or sets a value indicating whether the account has the profile's premium code: false while a code typed on this device waits for an account to take it, as when nobody is signed in or the account backend could not be reached. The default is true.

public bool IsAccessCodeSynced { get; set; }

Property Value

bool

Remarks

When someone is signed in, the app tries to upload the selected profile's waiting code at the next account refresh and right after a connect; a sign-out keeps a waiting code, as a code the account never took is the device's own. It is true for a code from the account, for a typed code once uploaded, and where there is no code.

IsBuiltIn

Gets or sets a value indicating whether the profile is one of the app's built-in access keys (AccessKeys), which an access key the person imports may not overwrite.

public bool IsBuiltIn { get; set; }

Property Value

bool

IsCustomServerEndpointsEnabled

Gets or sets a value indicating whether the profile connects to its own server addresses (CustomServerEndpoints). The default is true.

public bool IsCustomServerEndpointsEnabled { get; set; }

Property Value

bool

IsFavorite

Gets or sets a value indicating whether the profile is a favorite.

public bool IsFavorite { get; set; }

Property Value

bool

IsPremium

Gets a value indicating whether the profile is premium: its key is not public, or it holds a premium code, even one refused, expired or spent.

public bool IsPremium { get; }

Property Value

bool

Remarks

The app's own premium gates read it, such as its premium locations and its promotion, so nothing changes it behind the person's back. The access server checks the code again at each connect; where it refuses it, the app may get another code from the account and try again before it reports the refusal.

IsPremiumLocationSelected

Gets or sets a value indicating whether the location chosen is a premium one.

public bool IsPremiumLocationSelected { get; set; }

Property Value

bool

SelectedLocation

Gets or sets the server location chosen, or null for none.

public string? SelectedLocation { get; set; }

Property Value

string

Token

Gets or sets the access key's token, which the app connects with.

public required Token Token { get; set; }

Property Value

Token

VpnProfileId

Gets the profile's ID.

public required Guid VpnProfileId { get; init; }

Property Value

Guid

VpnProfileName

Gets or sets the profile's name, the key's own at first, or null.

public required string? VpnProfileName { get; set; }

Property Value

string