Skip to content

Commit 1980457

Browse files
author
Orie Steele
committed
Merge
2 parents c7cee92 + 4c57853 commit 1980457

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cwt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cose
22

3-
// https://www.iana.org/assignments/cwt/cwt.xhtml
3+
// https://www.iana.org/assignments/cwt/cwt.xhtml#claims-registry
44
const (
55
CWTClaimIssuer int64 = 1
66
CWTClaimSubject int64 = 2

cwt_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import (
1111

1212
// This example demonstrates signing and verifying COSE_Sign1 signatures.
1313
func 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")

0 commit comments

Comments
 (0)