DVWebPushVapid class

Builds the Authorization header a push service requires.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

audienceFor(String endpoint) → String
The origin of endpoint, which is what aud names.
authorizationHeader({required String endpoint, required DVWebPushKeyPair keyPair, String? subject, Duration expiry = defaultExpiry, DateTime? now}) → String
The vapid t=..., k=... header value for a message to endpoint.
claimsOf(String token) → Map<String, Object?>
The claims inside token, without checking its signature.
signedToken({required String audience, required DateTime expiresAt, required DVWebPushKeyPair keyPair, String? subject}) → String
A signed ES256 JWT with the VAPID claims.
verify(String token, Uint8List publicKey) → bool
Whether token was signed by publicKey.

Constants

defaultExpiry → const Duration
The default life. Well inside the maximum, so clock skew between this server and the push service cannot push a fresh token past it.
maximumExpiry → const Duration
The longest life a push service will accept for a token.