Keys and discovery
How uftp finds a sender's CS1 public key: a static Directory for configured deployments, the DNS records of UFTP Appendix 4, and key rollover with two keys.On this page
The key lookup#
open and Endpoint::receive take a closure from (domain, role) to that participant's public keys. Return one key, or two during a rollover. Return an error and the sender gets 419, which tells it to retry later.
A static directory#
For configured deployments and tests:
let directory = Directory::new()
.with(Participant::new("dso.example".parse()?, Role::Dso, dso_keys))
.with(Participant::new("agr.example".parse()?, Role::Agr, agr_keys)
.with_next_key(agr_next_keys)?); // a rollover: both verify until the old one is removed
endpoint.receive(body, now, directory.lookup())?;DNS#
Appendix 4 publishes participants in DNS. The library builds the names and parses the answers, and resolves nothing itself. Query the names with a DNSSEC-validating resolver of your choice:
| Record | Name | Holds |
|---|---|---|
| version | _usef.<domain> | the UFTP version |
| keys | _<role>._usef.<domain> | TXT: one or two cs1. keys |
| endpoint | _http._<role>._usef.<domain> | CNAME of the HTTPS endpoint |
| authorisation | _usef.<domain>.<suffix> | the regulator's zone vouching for the participant |
let name = dns::keys_record(&domain, Role::Agr); // "_agr._usef.agr.example"
let keys = dns::parse_keys_txt(&txt_value)?; // one or two keysA cs1. key is the Base64 of the 32-byte Ed25519 public key followed by the 32-byte encryption key.