cisco / node-jose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to sign with embedded key

bengivre opened this issue · comments

Hello,
I was wondering how to Sign content with embedded key using 'format : compact'

I'm trying to sign content.
If I do not use 'format: compact' I can see the key when I verify the token but the header is missing
When I use the option 'format: compact' , I get the header but not the key

With format: compact :

{"zip":"DEF","alg":"ES256","kid":"some-kind"}

And the token has the key

But without compact , I have the key , not the header

Can you tell me if you have an idea ?
Thanks

Here is part of the code i'm using

await jose.JWS.createSign({ format: 'compact' }, signingKey)
    .update(Buffer.from(compressedPayload), "UTF-8")
    .final()
    .then(function(result) {
        token = result;
});