YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.secure.PairingToken Class Reference

A pairing token of version 0 (spec, "Pairing Token"): "SP:" "0" and the base32 text of the client's public key and its Pairing PSK, 32 bytes each. More...

Collaboration diagram for de.yaacc.sendspin.secure.PairingToken:
Collaboration graph

Public Member Functions

byte[] clientKey ()
 The player's public key, 32 bytes (a copy).
 
byte[] pairingPsk ()
 The player's Pairing PSK, 32 bytes (a copy).
 
String clientId ()
 The player's client_id: base64url of its public key.
 
String toString ()
 

Static Public Member Functions

static String encode (byte[] clientKey, byte[] pairingPsk)
 
static PairingToken decode (String text)
 

Detailed Description

A pairing token of version 0 (spec, "Pairing Token"): "SP:" "0" and the base32 text of the client's public key and its Pairing PSK, 32 bytes each.

The operator copies it out of the player and pastes it into the server. It is a credential: whoever holds it can pair any server with that player, so it is never logged and its toString() shows nothing of it.

The text is the base32 of RFC 4648 (letters and 2 to 7) without padding, with every 2 written as 9 (so it fits the alphanumeric mode of a QR code). Decoding is lenient with what a person pastes (spaces, line breaks, any case, a missing SP:) and strict about everything else. Pure.

Member Function Documentation

◆ decode()

static PairingToken de.yaacc.sendspin.secure.PairingToken.decode ( String text)
static
Returns
the token, or null if the text is not a version 0 token (wrong version, bad characters, too short)

Referenced by de.yaacc.sendspin.SendspinPolicy.addDeviceToken(), and de.yaacc.sendspin.SendspinPolicy.pairWithToken().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: