A quick introduction on how data (identifiers & preferences cookies) and messages (operator requests and responses, tranmissions) are signed and how these signatures can be verified.
PAF Data format is designed to let the users audit how their preferences got to their current state. It relies on the signatures of data and communication, to enforce security.
All "signers" have a pair of private and a public Elliptic Curve Cryptography (ECC) keys, based on the secp256r1
curve.
- the private one must remain secret
- the public one needs to be accessible to anyone
A "signer" needs to calculate the signature to associate with an object (cookie or message).
- the signer computes the signature input for the object to sign
- usually, different properties from the object are "joined together" with the special separator character
\u2063
- but each type of object has its own rule to calculate the signature input. Refer to documentation these rules.
- usually, different properties from the object are "joined together" with the special separator character
Example:
transmission_result.source.domain + '\u2063' +
transmission_result.source.timestamp + '\u2063' +
seed.source.signature + '\u2063' +
source.domain + '\u2063' +
source.timestamp + '\u2063' +
transmission_response.receiver + '\u2063' +
transmission_response.status + '\u2063' +
transmission_response.details
-
the signer "hashes" this signature input with
RSA-SHA256
-
the signer signs this hashed input, using its private key
-
the signer encodes the signature as
base64
- the result is the signature
Example:
mKjGJ1uddqMc/V/XmG5JZ3t+F+qZKN6QeE4zKz4Xdsr0eEb+tYFnt1I67SqbRyJBv/kCNZ3qT/Go0TgHX4VDwQ==
A "verifier" wants to verify that the signature associated to an object is valid. It will require:
- the signature
- the data needed to verify it
The process is relatively similar:
-
the verifier computes the signature input for the object to verify
- based on the same rule, for this type of object. Refer to the documentation to know the rule to calculate the input for a particular object.
-
the verifier "hashes" this signature input with
RSA-SHA256
-
the signer decodes the signature from
base64
-
the signer verifies together, using the signer's public key:
- the hashed input
- the signature
-
the result of the verification is
true
if the signature is valid,false
otherwise