File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11package cose
22
3- // https://www.iana.org/assignments/cwt/cwt.xhtml
3+ // https://www.iana.org/assignments/cwt/cwt.xhtml#claims-registry
44const (
55 CWTClaimIssuer int64 = 1
66 CWTClaimSubject int64 = 2
Original file line number Diff line number Diff line change @@ -11,16 +11,16 @@ import (
1111
1212// This example demonstrates signing and verifying COSE_Sign1 signatures.
1313func ExampleCWTMessage () {
14-
1514 // create message to be signed
1615 msgToSign := cose .NewSign1Message ()
1716 msgToSign .Payload = []byte ("hello world" )
1817 msgToSign .Headers .Protected .SetAlgorithm (cose .AlgorithmES512 )
1918
2019 msgToSign .Headers .Protected .SetType ("application/cwt" )
21- claims := make (cose.CWTClaims )
22- claims [cose .CWTClaimIssuer ] = "issuer.example"
23- claims [cose .CWTClaimSubject ] = "subject.example"
20+ claims := cose.CWTClaims {
21+ cose .CWTClaimIssuer : "issuer.example" ,
22+ cose .CWTClaimSubject : "subject.example" ,
23+ }
2424 msgToSign .Headers .Protected .SetCWTClaims (claims )
2525
2626 msgToSign .Headers .Unprotected [cose .HeaderLabelKeyID ] = []byte ("1" )
You can’t perform that action at this time.
0 commit comments