Package org.mozilla.geckoview
Class WebPushSubscription
Object
org.mozilla.geckoview.WebPushSubscription
- All Implemented Interfaces:
Parcelable
This class represents a single Web Push subscription, as described in the Web Push API specification.
This is a low-level interface, allowing applications to do all of the heavy lifting themselves. It is recommended that consumers have a thorough understanding of the Web Push API, especially RFC 8291.
Only trivial sanity checks are performed on the values held here. The application must ensure it is generating compliant keys/secrets itself.
-
Nested Class Summary
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionfinal byte[]
This is an optional public key provided by the application server to authenticate itself with the endpoint, formatted according to X9.62.final byte[]
16 byte secret key, generated by the embedder, to be provided to the app server for use in encrypting and authenticating messages sent to theendpoint
.final byte[]
The P-256 EC public key, formatted as X9.62, generated by the embedder, to be provided to the app server for message encryption.static final Parcelable.Creator<WebPushSubscription>
final String
The Web Push endpoint for this subscription.final String
The Service Worker scope associated with this subscription.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
ConstructorDescriptionWebPushSubscription
(String scope, String endpoint, byte[] appServerKey, byte[] browserPublicKey, byte[] authSecret) -
Method Summary
-
Field Details
-
scope
The Service Worker scope associated with this subscription.- See Also:
-
endpoint
The Web Push endpoint for this subscription. This is the URL of a web service which implements the Web Push protocol.- See Also:
-
appServerKey
@Nullable public final byte[] appServerKeyThis is an optional public key provided by the application server to authenticate itself with the endpoint, formatted according to X9.62.This key is used for VAPID, the Voluntary Application Server Identification (VAPID) for Web Push, from RFC 8292.
-
browserPublicKey
@NonNull public final byte[] browserPublicKeyThe P-256 EC public key, formatted as X9.62, generated by the embedder, to be provided to the app server for message encryption. -
authSecret
@NonNull public final byte[] authSecret16 byte secret key, generated by the embedder, to be provided to the app server for use in encrypting and authenticating messages sent to theendpoint
. -
CREATOR
-
-
Constructor Details
-
WebPushSubscription
-
-
Method Details
-
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceParcelable
-
writeToParcel
- Specified by:
writeToParcel
in interfaceParcelable
-