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

The values around the code-based pairing of the Sendspin specification (issue #325, task 11.1; "Dynamic Pairing Code Flow", "Static Pairing Code Flow", "Pairing Token", "PAKE", "Wrapping"): the pairing code derived from the Noise handshake hash and the two nonces, the commitment to the client's nonce, the session id of the PAKE, the wrapping of the long-term PSK and of the nonce under the key of the run, the version 1 token that carries a code as text or QR code, and the entry of a typed code. More...

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

Static Public Member Functions

static byte[] codeDigest (byte[] h, byte[] nonceA, byte[] nonceB)
 SHA-256("sendspin-pairing-code-derive-v1" || h || nonce_A || nonce_B).
 
static String digitsCode (byte[] digest)
 The 6 ASCII digits: the digest as a big-endian integer mod 10^6, zero padded on the left.
 
static byte[] qrCode (byte[] digest)
 The code of the qr_code format: the first 24 bytes of the digest.
 
static byte[] commit (byte[] nonceB)
 commit_B = SHA-256("sendspin-pair-commit-v1" || nonce_B).
 
static byte[] pakeSid (byte[] h, int pairingIndex, int round)
 The sid of the PAKE: "sendspin-pair-pake-v1" || h || pairing_index (uint32 BE) || round (uint32 BE).
 
static String codeToken (byte[] code)
 The text of a code of 24 bytes as a version 1 pairing token (what the client shows as a QR code).
 
static byte[] decodeCodeToken (String text)
 
static String normalizeDigits (String typed, int digits)
 A typed code without spaces and hyphens; null unless it is exactly digits digits.
 
static String group (String digits)
 The presentation of a code: 123-456 for 6 digits, 1234-5678 for 8 (the value stays the contiguous digits).
 
static byte[] wrapPsk (NoiseSuite suite, byte[] sid, byte[] isk, byte[] psk) throws NoiseException
 The new long-term PSK, sealed for client/pair-finalize.
 
static byte[] unwrapPsk (NoiseSuite suite, byte[] sid, byte[] isk, byte[] wrapped) throws NoiseException
 
static byte[] wrapNonce (NoiseSuite suite, byte[] sid, byte[] isk, byte[] nonceB) throws NoiseException
 The opening of the commitment, sealed for client/pair-confirm.
 
static byte[] unwrapNonce (NoiseSuite suite, byte[] sid, byte[] isk, byte[] wrapped) throws NoiseException
 

Static Public Attributes

static final int NONCE_BYTES = 32
 
static final int DYNAMIC_DIGITS = 6
 The digits of a dynamic code.
 
static final int STATIC_DIGITS = 8
 The digits of a static code.
 
static final int QR_CODE_BYTES = 24
 The bytes of a code in the qr_code format.
 
static final int WRAPPED_BYTES = 48
 

Detailed Description

The values around the code-based pairing of the Sendspin specification (issue #325, task 11.1; "Dynamic Pairing Code Flow", "Static Pairing Code Flow", "Pairing Token", "PAKE", "Wrapping"): the pairing code derived from the Noise handshake hash and the two nonces, the commitment to the client's nonce, the session id of the PAKE, the wrapping of the long-term PSK and of the nonce under the key of the run, the version 1 token that carries a code as text or QR code, and the entry of a typed code.

Pure; the hashes are the platform's, the AEAD is the one of the connection's suite.

Member Function Documentation

◆ decodeCodeToken()

static byte[] de.yaacc.sendspin.secure.PairingCodes.decodeCodeToken ( String text)
static
Returns
the 24 bytes of the code of a version 1 token (typed or scanned), or null if the text is not one

Referenced by de.yaacc.sendspin.pairing.CodePairingServer.provideCode().

Here is the caller graph for this function:

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