Class VpnProfileService
- Namespace
- VpnHood.AppLib.App.VpnProfiles
- Assembly
- VpnHood.AppLib.App.dll
Provides the VPN profiles, kept in the storage's profiles folder
(VpnProfileService).
public class VpnProfileService
- Inheritance
-
VpnProfileService
- Inherited Members
Remarks
Its members are safe to call from any thread.
Methods
ImportAccessKey(string)
Adds an access key as a VPN profile, or updates the profiles of its token with it, and saves the profiles.
public VpnProfile ImportAccessKey(string accessKey)
Parameters
accessKeystringThe access key.
Returns
- VpnProfile
The profile of the key's token.
Exceptions
- FormatException
The key is not valid.
- NotSupportedException
The key's version is not supported.
- JsonException
The key's JSON is not valid.
- InvalidDataException
The key's JSON is
null.- OverflowException
A duration in the key is out of range.
- UnauthorizedAccessException
The key is a built-in profile's (IsBuiltIn), or the process may not write the profiles.
- IOException
The profiles could not be saved.
List()
Returns the VPN profiles.
public VpnProfile[] List()
Returns
- VpnProfile[]
The profiles, in a new array.