Passa al contenuto principale

A.3. Example Signed CWT (CWT firmato di esempio)

A.3. Example Signed CWT (CWT firmato di esempio)

Questa sezione mostra un CWT firmato con un singolo destinatario e un CWT Claims Set completo.

La firma è generata usando la chiave privata elencata nell'Appendice A.2.3 e può essere convalidata usando la chiave pubblica dall'Appendice A.2.3. Le interruzioni di riga servono solo alla visualizzazione.

d28443a10126a104524173796d6d657472696345434453413235365850a701756
36f61703a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f
61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d
9f0061a5610d9f007420b7158405427c1ff28d23fbad1f29c4c7c6a555e601d6f
a29f9179bc3d7438bacaca5acd08c8d4d4f96131680c429a01f85951ecee743a5
2b9b63632c57209120e1c9e30

Figura 10: CWT firmato come stringa esadecimale

18(
[
/ protected / << {
/ alg / 1: -7 / ECDSA 256 /
} >>,
/ unprotected / {
/ kid / 4: h'4173796d6d657472696345434453413
23536' / 'AsymmetricECDSA256' /
},
/ payload / << {
/ iss / 1: "coap://as.example.com",
/ sub / 2: "erikw",
/ aud / 3: "coap://light.example.com",
/ exp / 4: 1444064944,
/ nbf / 5: 1443944944,
/ iat / 6: 1443944944,
/ cti / 7: h'0b71'
} >>,
/ signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f
9179bc3d7438bacaca5acd08c8d4d4f96131680c42
9a01f85951ecee743a52b9b63632c57209120e1c9e
30'
]
)

Figura 11: CWT firmato in notazione diagnostica CBOR