YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.fcast.protocol.FCastPin Class Reference

The fingerprint of a receiver's key (FCast v4, docs/tech.md, "FCast v4"): SHA-256 of the DER SubjectPublicKeyInfo of its self-signed certificate, written as standard base64 in the fp of the mDNS record and of an fcast://r/ link. More...

Collaboration diagram for de.yaacc.fcast.protocol.FCastPin:
Collaboration graph

Classes

enum  Source
 Where the fingerprint came from; the link is the stronger source (a channel the network can not change). More...
 

Public Member Functions

boolean matches (X509Certificate certificate)
 True if the certificate's key has this pin's hash (constant time).
 
FCastPin withSource (Source other)
 The same key with another source.
 
Source getSource ()
 
String toBase64 ()
 The fp text.
 
boolean equals (Object other)
 
int hashCode ()
 
String toString ()
 

Static Public Member Functions

static FCastPin parse (String base64, Source source)
 
static FCastPin of (byte[] sha256, Source source)
 
static FCastPin of (X509Certificate certificate, Source source)
 The pin of a certificate (what the receiver would announce); used by tests and by the sheet to show what was seen.
 

Static Public Attributes

static final int LENGTH = 32
 Bytes of a SHA-256 digest.
 

Detailed Description

The fingerprint of a receiver's key (FCast v4, docs/tech.md, "FCast v4"): SHA-256 of the DER SubjectPublicKeyInfo of its self-signed certificate, written as standard base64 in the fp of the mDNS record and of an fcast://r/ link.

Immutable. The connection to a receiver that has a pin is trusted only if the certificate's key has exactly this hash.

Member Function Documentation

◆ parse()

static FCastPin de.yaacc.fcast.protocol.FCastPin.parse ( String base64,
Source source )
static
Parameters
base64the fp text (standard base64, padding allowed but not needed)
Returns
the pin, or null if the text is not base64 of exactly 32 bytes

Referenced by de.yaacc.fcast.discovery.FCastPins.pinFor().

Here is the caller graph for this function:

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