Class VapidAuthentication
Class which provides Voluntary Application Server Identification (VAPID) headers values.
Inheritance
Implements
Inherited Members
Namespace: Lib.Net.Http.WebPush.Authentication
Assembly: Lib.Net.Http.WebPush.dll
Syntax
public class VapidAuthentication : IDisposable
Constructors
VapidAuthentication(String, String)
Creates new instance of VapidAuthentication class.
Declaration
public VapidAuthentication(string publicKey, string privateKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | publicKey | The Application Server Public Key. |
System.String | privateKey | The Application Server Private Key. |
Properties
Expiration
Gets or sets the time after which the authentication token expires (in seconds).
Declaration
public int Expiration { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PrivateKey
Gets or sets the Application Server Private Key.
Declaration
public string PrivateKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PublicKey
Gets or sets the Application Server Public Key.
Declaration
public string PublicKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Subject
Gets or sets the contact information for the application server.
Declaration
public string Subject { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TokenCache
Gets or sets the token cache.
Declaration
public IVapidTokenCache TokenCache { get; set; }
Property Value
Type | Description |
---|---|
IVapidTokenCache |
Methods
Dispose()
Releases all resources used by the current instance of the VapidAuthentication class.
Declaration
public void Dispose()
GetVapidSchemeAuthenticationHeaderValueParameter(String)
Gets System.Net.Http.Headers.AuthenticationHeaderValue parameter for Vapid.
Declaration
public string GetVapidSchemeAuthenticationHeaderValueParameter(string audience)
Parameters
Type | Name | Description |
---|---|---|
System.String | audience | The origin of the push resource. |
Returns
Type | Description |
---|---|
System.String | The System.Net.Http.Headers.AuthenticationHeaderValue parameter for Vapid. |
GetWebPushSchemeHeadersValues(String)
Gets values for headers used in case of WebPush.
Declaration
public VapidAuthentication.WebPushSchemeHeadersValues GetWebPushSchemeHeadersValues(string audience)
Parameters
Type | Name | Description |
---|---|---|
System.String | audience | The origin of the push resource. |
Returns
Type | Description |
---|---|
VapidAuthentication.WebPushSchemeHeadersValues | The values for headers used in case of WebPush. |