Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 5fc046e

Browse files
If KeyId is empty, do not include it in the header.
1 parent 730df5f commit 5fc046e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

signing.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ func (ctx *genericSigner) Sign(payload []byte) (*JSONWebSignature, error) {
233233
if ctx.embedJWK {
234234
protected[headerJWK] = recipient.publicKey()
235235
} else {
236-
protected[headerKeyID] = recipient.publicKey().KeyID
236+
keyID := recipient.publicKey().KeyID
237+
if keyID != "" {
238+
protected[headerKeyID] = keyID
239+
}
237240
}
238241
}
239242

0 commit comments

Comments
 (0)