diff --git a/docs/types/interfaces/CompactDecryptResult.md b/docs/types/interfaces/CompactDecryptResult.md index 640f8362fa..682fa719c3 100644 --- a/docs/types/interfaces/CompactDecryptResult.md +++ b/docs/types/interfaces/CompactDecryptResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Compact JWE decryption result + ## Properties ### plaintext diff --git a/docs/types/interfaces/CompactVerifyResult.md b/docs/types/interfaces/CompactVerifyResult.md index 05e837b1bb..fd4adf8d6a 100644 --- a/docs/types/interfaces/CompactVerifyResult.md +++ b/docs/types/interfaces/CompactVerifyResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Compact JWS verification result + ## Properties ### payload diff --git a/docs/types/interfaces/FlattenedDecryptResult.md b/docs/types/interfaces/FlattenedDecryptResult.md index 5517fdc30b..3b938208a7 100644 --- a/docs/types/interfaces/FlattenedDecryptResult.md +++ b/docs/types/interfaces/FlattenedDecryptResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Flattened JWE JSON Serialization Syntax decryption result + ## Properties ### plaintext diff --git a/docs/types/interfaces/FlattenedVerifyResult.md b/docs/types/interfaces/FlattenedVerifyResult.md index e80be9d1e0..d7ce0174f5 100644 --- a/docs/types/interfaces/FlattenedVerifyResult.md +++ b/docs/types/interfaces/FlattenedVerifyResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Flattened JWS JSON Serialization Syntax verification result + ## Properties ### payload diff --git a/docs/types/interfaces/GeneralDecryptResult.md b/docs/types/interfaces/GeneralDecryptResult.md index b22f31b2a6..23b6328545 100644 --- a/docs/types/interfaces/GeneralDecryptResult.md +++ b/docs/types/interfaces/GeneralDecryptResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Flattened JWE JSON Serialization Syntax decryption result + ## Properties ### plaintext diff --git a/docs/types/interfaces/GeneralVerifyResult.md b/docs/types/interfaces/GeneralVerifyResult.md index 4f75134bfb..6285959f88 100644 --- a/docs/types/interfaces/GeneralVerifyResult.md +++ b/docs/types/interfaces/GeneralVerifyResult.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Flattened JWS JSON Serialization Syntax verification result + ## Properties ### payload diff --git a/docs/types/interfaces/JoseHeaderParameters.md b/docs/types/interfaces/JoseHeaderParameters.md index f94598f0fd..83c65d46ad 100644 --- a/docs/types/interfaces/JoseHeaderParameters.md +++ b/docs/types/interfaces/JoseHeaderParameters.md @@ -4,6 +4,8 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). +Header Parameters common to JWE and JWS + ## Properties ### cty? diff --git a/docs/util/decode_protected_header/type-aliases/ProtectedHeaderParameters.md b/docs/util/decode_protected_header/type-aliases/ProtectedHeaderParameters.md index 48fcf6b205..ccd5c1ad61 100644 --- a/docs/util/decode_protected_header/type-aliases/ProtectedHeaderParameters.md +++ b/docs/util/decode_protected_header/type-aliases/ProtectedHeaderParameters.md @@ -5,3 +5,5 @@ Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). • **ProtectedHeaderParameters**: [`JWSHeaderParameters`](../../../types/interfaces/JWSHeaderParameters.md) & [`JWEHeaderParameters`](../../../types/interfaces/JWEHeaderParameters.md) + +JWE and JWS Header Parameters diff --git a/src/types.d.ts b/src/types.d.ts index 397cb4e46b..742bfed8f5 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -233,6 +233,7 @@ export interface GeneralJWS { signatures: Omit[] } +/** Header Parameters common to JWE and JWS */ export interface JoseHeaderParameters { /** "kid" (Key ID) Header Parameter */ kid?: string @@ -584,6 +585,7 @@ export interface JWTPayload { [propName: string]: unknown } +/** Flattened JWE JSON Serialization Syntax decryption result */ export interface FlattenedDecryptResult { /** JWE AAD. */ additionalAuthenticatedData?: Uint8Array @@ -601,8 +603,10 @@ export interface FlattenedDecryptResult { unprotectedHeader?: JWEHeaderParameters } +/** Flattened JWE JSON Serialization Syntax decryption result */ export interface GeneralDecryptResult extends FlattenedDecryptResult {} +/** Compact JWE decryption result */ export interface CompactDecryptResult { /** Plaintext. */ plaintext: Uint8Array @@ -611,6 +615,7 @@ export interface CompactDecryptResult { protectedHeader: CompactJWEHeaderParameters } +/** Flattened JWS JSON Serialization Syntax verification result */ export interface FlattenedVerifyResult { /** JWS Payload. */ payload: Uint8Array @@ -622,8 +627,10 @@ export interface FlattenedVerifyResult { unprotectedHeader?: JWSHeaderParameters } +/** Flattened JWS JSON Serialization Syntax verification result */ export interface GeneralVerifyResult extends FlattenedVerifyResult {} +/** Compact JWS verification result */ export interface CompactVerifyResult { /** JWS Payload. */ payload: Uint8Array diff --git a/src/util/decode_protected_header.ts b/src/util/decode_protected_header.ts index a9bd1231e3..730a468d39 100644 --- a/src/util/decode_protected_header.ts +++ b/src/util/decode_protected_header.ts @@ -9,6 +9,7 @@ import { decoder } from '../lib/buffer_utils.js' import isObject from '../lib/is_object.js' import type * as types from '../types.d.ts' +/** JWE and JWS Header Parameters */ export type ProtectedHeaderParameters = types.JWSHeaderParameters & types.JWEHeaderParameters /**