Skip to content

Commit 56682b4

Browse files
committed
docs: clarify return of general jws and jwe
1 parent 8d7d59c commit 56682b4

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

docs/jwe/general/decrypt/functions/generalDecrypt.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Decrypts a General JWE.
1313
This function is exported (as a named export) from the main `'jose'` module entry point as well
1414
as from its subpath export `'jose/jwe/general/decrypt'`.
1515

16+
> [!NOTE]\
17+
> The function iterates over the `recipients` array in the General JWE and returns the
18+
> decryption result of the first recipient entry that can be successfully decrypted. The result
19+
> only contains the plaintext and headers of that successfully decrypted recipient entry. Other
20+
> recipient entries in the General JWE are not validated, and their headers are not included in
21+
> the returned result. Recipients of a General JWE should only rely on the returned (decrypted)
22+
> data.
23+
1624
### Parameters
1725

1826
| Parameter | Type | Description |

docs/jws/general/verify/functions/generalVerify.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Verifies the signature and format of and afterwards decodes the General JWS.
1313
This function is exported (as a named export) from the main `'jose'` module entry point as well
1414
as from its subpath export `'jose/jws/general/verify'`.
1515

16+
> [!NOTE]\
17+
> The function iterates over the `signatures` array in the General JWS and returns the
18+
> verification result of the first signature entry that can be successfully verified. The result
19+
> only contains the payload, protected header, and unprotected header of that successfully
20+
> verified signature entry. Other signature entries in the General JWS are not validated, and
21+
> their headers are not included in the returned result. Recipients of a General JWS should only
22+
> rely on the returned (verified) data.
23+
1624
### Parameters
1725

1826
| Parameter | Type | Description |

src/jwe/general/decrypt.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ export interface GeneralDecryptGetKey extends types.GetKeyFunction<
2424
* This function is exported (as a named export) from the main `'jose'` module entry point as well
2525
* as from its subpath export `'jose/jwe/general/decrypt'`.
2626
*
27+
* > [!NOTE]\
28+
* > The function iterates over the `recipients` array in the General JWE and returns the
29+
* > decryption result of the first recipient entry that can be successfully decrypted. The result
30+
* > only contains the plaintext and headers of that successfully decrypted recipient entry. Other
31+
* > recipient entries in the General JWE are not validated, and their headers are not included in
32+
* > the returned result. Recipients of a General JWE should only rely on the returned (decrypted)
33+
* > data.
34+
*
2735
* @example
2836
*
2937
* ```js

src/jws/general/verify.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export interface GeneralVerifyGetKey extends types.GenericGetKeyFunction<
2727
* This function is exported (as a named export) from the main `'jose'` module entry point as well
2828
* as from its subpath export `'jose/jws/general/verify'`.
2929
*
30+
* > [!NOTE]\
31+
* > The function iterates over the `signatures` array in the General JWS and returns the
32+
* > verification result of the first signature entry that can be successfully verified. The result
33+
* > only contains the payload, protected header, and unprotected header of that successfully
34+
* > verified signature entry. Other signature entries in the General JWS are not validated, and
35+
* > their headers are not included in the returned result. Recipients of a General JWS should only
36+
* > rely on the returned (verified) data.
37+
*
3038
* @example
3139
*
3240
* ```js

0 commit comments

Comments
 (0)