Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Jun 21, 2024
2 parents c7cee92 + 4c57853 commit 1980457
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cwt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cose

// https://www.iana.org/assignments/cwt/cwt.xhtml
// https://www.iana.org/assignments/cwt/cwt.xhtml#claims-registry
const (
CWTClaimIssuer int64 = 1
CWTClaimSubject int64 = 2
Expand Down
8 changes: 4 additions & 4 deletions cwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import (

// This example demonstrates signing and verifying COSE_Sign1 signatures.
func ExampleCWTMessage() {

// create message to be signed
msgToSign := cose.NewSign1Message()
msgToSign.Payload = []byte("hello world")
msgToSign.Headers.Protected.SetAlgorithm(cose.AlgorithmES512)

msgToSign.Headers.Protected.SetType("application/cwt")
claims := make(cose.CWTClaims)
claims[cose.CWTClaimIssuer] = "issuer.example"
claims[cose.CWTClaimSubject] = "subject.example"
claims := cose.CWTClaims{
cose.CWTClaimIssuer: "issuer.example",
cose.CWTClaimSubject: "subject.example",
}
msgToSign.Headers.Protected.SetCWTClaims(claims)

msgToSign.Headers.Unprotected[cose.HeaderLabelKeyID] = []byte("1")
Expand Down

0 comments on commit 1980457

Please sign in to comment.