mirror of
https://github.com/danbulant/jose
synced 2026-05-24 20:41:46 +00:00
docs: quick readme examples showing protected header
[skip ci]
This commit is contained in:
parent
6453e1ffc9
commit
d6923bdb31
1 changed files with 7 additions and 5 deletions
12
README.md
12
README.md
|
|
@ -169,13 +169,13 @@ jose.JWT.sign(
|
|||
{ 'urn:example:claim': 'foo' },
|
||||
privateKey,
|
||||
{
|
||||
expiresIn: '1 hour',
|
||||
issuer: 'https://op.example.com',
|
||||
algorithm: 'PS256',
|
||||
audience: 'urn:example:client_id',
|
||||
expiresIn: '1 hour',
|
||||
header: {
|
||||
typ: 'JWT'
|
||||
},
|
||||
algorithm: 'PS256'
|
||||
issuer: 'https://op.example.com'
|
||||
}
|
||||
)
|
||||
```
|
||||
|
|
@ -205,7 +205,8 @@ Sign with a private or symmetric key using compact serialization. See the
|
|||
```js
|
||||
jose.JWS.sign(
|
||||
{ sub: 'johndoe' },
|
||||
privateKey
|
||||
privateKey,
|
||||
{ kid: privateKey.kid }
|
||||
)
|
||||
```
|
||||
|
||||
|
|
@ -228,7 +229,8 @@ Encrypt using the recipient's public key or a shared symmetrical secret. See the
|
|||
```js
|
||||
jose.JWE.encrypt(
|
||||
'eyJhbGciOiJFUzI1NiJ9.eyJzdWIiOiJqb2huZG9lIn0.T_SYLQV3A5_kFDDVNuoadoURSEtuSOR-dG2CMmrP-ULK9xbIf2vYeiHOkvTrnqGlWEGBGxYtsP1VkXmNsi1uOw',
|
||||
publicKey
|
||||
publicKey,
|
||||
{ kid: publicKey.kid }
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue