@owf/eudi-registration-certificate 0.0.0-stage → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/entitlements.ts","../src/schemas.ts","../src/wrprc-exception.ts","../src/builders.ts","../src/dialect.ts","../src/validator.ts","../src/signer.ts"],"sourcesContent":["/**\n * WRPRC Entitlement Constants\n *\n * Entitlement identifiers as defined in ETSI TS 119 475 Annex A.\n * These identifiers define the roles and capabilities of Wallet-Relying Parties.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\n// ============================================================================\n// OID Base\n// ============================================================================\n\n/**\n * Base OID for ETSI WRPA entitlements: 0.4.0.19475\n * id-etsi-wrpa OBJECT IDENTIFIER ::= { itu-t(0) identified-organization(4) etsi(0) 19475 }\n */\nexport const ETSI_WRPA_BASE_OID = '0.4.0.19475'\n\n/**\n * OID arc for entitlements: 0.4.0.19475.1\n */\nexport const ETSI_WRPA_ENTITLEMENT_ARC = `${ETSI_WRPA_BASE_OID}.1`\n\n// ============================================================================\n// WRP Entitlement URIs (A.2)\n// ============================================================================\n\n/**\n * Service_Provider - General service provider (A.2.1)\n * OID: id-etsi-wrpa-entitlement 1\n */\nexport const ENTITLEMENT_SERVICE_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/Service_Provider'\n\n/**\n * QEAA_Provider - Qualified trust service provider issuing qualified electronic attestations of attributes (A.2.2)\n * OID: id-etsi-wrpa-entitlement 2\n */\nexport const ENTITLEMENT_QEAA_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/QEAA_Provider'\n\n/**\n * Non_Q_EAA_Provider - Trust service provider issuing non-qualified electronic attestations of attributes (A.2.3)\n * OID: id-etsi-wrpa-entitlement 3\n */\nexport const ENTITLEMENT_NON_Q_EAA_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/Non_Q_EAA_Provider'\n\n/**\n * PUB_EAA_Provider - Public sector body or its agent issuing electronic attestations of attributes from authentic sources (A.2.4)\n * OID: id-etsi-wrpa-entitlement 4\n */\nexport const ENTITLEMENT_PUB_EAA_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/PUB_EAA_Provider'\n\n/**\n * PID_Provider - Provider of person identification data (A.2.5)\n * OID: id-etsi-wrpa-entitlement 5\n */\nexport const ENTITLEMENT_PID_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/PID_Provider'\n\n/**\n * QCert_for_ESeal_Provider - QTSP issuing qualified certificates for electronic seals (A.2.6)\n * OID: id-etsi-wrpa-entitlement 6\n */\nexport const ENTITLEMENT_QCERT_FOR_ESEAL_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/QCert_for_ESeal_Provider'\n\n/**\n * QCert_for_ESig_Provider - QTSP issuing qualified certificates for electronic signatures (A.2.7)\n * OID: id-etsi-wrpa-entitlement 7\n */\nexport const ENTITLEMENT_QCERT_FOR_ESIG_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/QCert_for_ESig_Provider'\n\n/**\n * rQSealCDs_Provider - QTSP managing remote qualified electronic seal creation devices (A.2.8)\n * OID: id-etsi-wrpa-entitlement 8\n */\nexport const ENTITLEMENT_RQSEALCDS_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/rQSealCDs_Provider'\n\n/**\n * rQSigCDs_Provider - QTSP managing remote qualified electronic signature creation devices (A.2.9)\n * OID: id-etsi-wrpa-entitlement 9\n */\nexport const ENTITLEMENT_RQSIGCDS_PROVIDER = 'https://uri.etsi.org/19475/Entitlement/rQSigCDs_Provider'\n\n/**\n * ESig_ESeal_Creation_Provider - Non-qualified provider for remote signature/seal creation (A.2.10)\n * OID: id-etsi-wrpa-entitlement 10\n */\nexport const ENTITLEMENT_ESIG_ESEAL_CREATION_PROVIDER =\n 'https://uri.etsi.org/19475/Entitlement/ESig_ESeal_Creation_Provider'\n\n// ============================================================================\n// Entitlement Collection\n// ============================================================================\n\n/**\n * All standard WRP entitlements defined in ETSI TS 119 475\n */\nexport const WRP_ENTITLEMENTS = {\n SERVICE_PROVIDER: ENTITLEMENT_SERVICE_PROVIDER,\n QEAA_PROVIDER: ENTITLEMENT_QEAA_PROVIDER,\n NON_Q_EAA_PROVIDER: ENTITLEMENT_NON_Q_EAA_PROVIDER,\n PUB_EAA_PROVIDER: ENTITLEMENT_PUB_EAA_PROVIDER,\n PID_PROVIDER: ENTITLEMENT_PID_PROVIDER,\n QCERT_FOR_ESEAL_PROVIDER: ENTITLEMENT_QCERT_FOR_ESEAL_PROVIDER,\n QCERT_FOR_ESIG_PROVIDER: ENTITLEMENT_QCERT_FOR_ESIG_PROVIDER,\n RQSEALCDS_PROVIDER: ENTITLEMENT_RQSEALCDS_PROVIDER,\n RQSIGCDS_PROVIDER: ENTITLEMENT_RQSIGCDS_PROVIDER,\n ESIG_ESEAL_CREATION_PROVIDER: ENTITLEMENT_ESIG_ESEAL_CREATION_PROVIDER,\n} as const\n\n/**\n * List of all standard entitlement URIs\n */\nexport const ALL_ENTITLEMENTS = Object.values(WRP_ENTITLEMENTS)\n\n/**\n * Entitlements for attestation providers (QEAA, Non-Q EAA, PUB EAA, PID)\n */\nexport const ATTESTATION_PROVIDER_ENTITLEMENTS = [\n ENTITLEMENT_QEAA_PROVIDER,\n ENTITLEMENT_NON_Q_EAA_PROVIDER,\n ENTITLEMENT_PUB_EAA_PROVIDER,\n ENTITLEMENT_PID_PROVIDER,\n] as const\n\n// ============================================================================\n// Service Provider Sub-entitlements (A.3)\n// ============================================================================\n\n/**\n * Payment Service Provider Sub-entitlements (A.3.1)\n * As defined in ETSI TS 119 495\n */\nexport const PSP_SUB_ENTITLEMENTS = {\n /** Account Servicing Payment Service Provider */\n ACCOUNT_SERVICING: 'https://uri.etsi.org/19475/SubEntitlement/psp/psp-as',\n /** Payment Initiation Service Provider */\n PAYMENT_INITIATION: 'https://uri.etsi.org/19475/SubEntitlement/psp/psp-pi',\n /** Account Information Service Provider */\n ACCOUNT_INFORMATION: 'https://uri.etsi.org/19475/SubEntitlement/psp/psp-ai',\n /** Payment Service Provider issuing card-based payment instruments */\n CARD_BASED: 'https://uri.etsi.org/19475/SubEntitlement/psp/psp-ic',\n /** Unspecified Payment Service Provider */\n UNSPECIFIED: 'https://uri.etsi.org/19475/SubEntitlement/psp/unspecified',\n} as const\n\n/**\n * All PSP sub-entitlement URIs\n */\nexport const ALL_PSP_SUB_ENTITLEMENTS = Object.values(PSP_SUB_ENTITLEMENTS)\n\n// ============================================================================\n// Identifier Type URIs (B.2.5 Class Identifier)\n// ============================================================================\n\n/**\n * Identifier type URIs for legal person semantic identifiers\n */\nexport const IDENTIFIER_TYPES = {\n /** Economic Operator Registration and Identification Number (EORI-No) */\n EORI: 'http://data.europa.eu/eudi/id/EORI-No',\n /** Legal Entity Identifier (LEI) */\n LEI: 'http://data.europa.eu/eudi/id/LEI',\n /** European Unique Identifier (EUID) */\n EUID: 'http://data.europa.eu/eudi/id/EUID',\n /** Value Added Tax Identification Number (VATIN) */\n VATIN: 'http://data.europa.eu/eudi/id/VATIN',\n /** Taxpayer Identification Number (TIN) */\n TIN: 'http://data.europa.eu/eudi/id/TIN',\n /** Excise Number */\n EXCISE: 'http://data.europa.eu/eudi/id/Excise',\n} as const\n\n/**\n * Mapping from identifier type URIs to semantic identifier initial characters\n * for legal persons (Table 2, ETSI EN 319 412-1 clause 5.1.4).\n *\n * Note that the TIN type maps to the `VAT` initial characters for legal persons.\n */\nexport const LEGAL_PERSON_IDENTIFIER_PREFIXES: Record<string, string> = {\n [IDENTIFIER_TYPES.EORI]: 'EOR',\n [IDENTIFIER_TYPES.LEI]: 'LEI',\n [IDENTIFIER_TYPES.EUID]: 'NTR',\n [IDENTIFIER_TYPES.VATIN]: 'VAT',\n [IDENTIFIER_TYPES.TIN]: 'VAT',\n [IDENTIFIER_TYPES.EXCISE]: 'EXC',\n}\n\n/**\n * Mapping from identifier type URIs to semantic identifier initial characters\n * for natural persons (Table 4, ETSI EN 319 412-1 clause 5.1.3).\n */\nexport const NATURAL_PERSON_IDENTIFIER_PREFIXES: Record<string, string> = {\n [IDENTIFIER_TYPES.VATIN]: 'TIN',\n [IDENTIFIER_TYPES.TIN]: 'TIN',\n}\n\n// ============================================================================\n// Policy Type URIs (B.2.8 Class Policy)\n// ============================================================================\n\n/**\n * Policy type URIs\n */\nexport const POLICY_TYPES = {\n /** Privacy Policy */\n PRIVACY_POLICY: 'http://data.europa.eu/eudi/policy/privacy-policy',\n} as const\n\n// ============================================================================\n// Certificate Policy OIDs (clause 6.1.3)\n// ============================================================================\n\n/**\n * Base OID for WRPRC policies: 0.4.0.19475.3\n */\nexport const WRPRC_POLICY_BASE_OID = `${ETSI_WRPA_BASE_OID}.3`\n\n/**\n * WRPRC Policy OIDs\n */\nexport const WRPRC_POLICIES = {\n /** WRPRC provider policy identifier */\n WRPRC_PROVIDER: `${WRPRC_POLICY_BASE_OID}.1`,\n} as const\n\n// ============================================================================\n// Type Guards and Helpers\n// ============================================================================\n\n/**\n * Check if a given URI is a valid WRP entitlement\n */\nexport function isValidEntitlement(uri: string): boolean {\n return ALL_ENTITLEMENTS.includes(uri as (typeof ALL_ENTITLEMENTS)[number])\n}\n\n/**\n * Check if a given URI is a PSP sub-entitlement\n */\nexport function isPSPSubEntitlement(uri: string): boolean {\n return ALL_PSP_SUB_ENTITLEMENTS.includes(uri as (typeof ALL_PSP_SUB_ENTITLEMENTS)[number])\n}\n\n/**\n * Check if entitlements include an attestation provider role\n */\nexport function hasAttestationProviderEntitlement(entitlements: string[]): boolean {\n return entitlements.some((e) =>\n ATTESTATION_PROVIDER_ENTITLEMENTS.includes(e as (typeof ATTESTATION_PROVIDER_ENTITLEMENTS)[number])\n )\n}\n\n/**\n * Get the semantic identifier initial characters for a given identifier type URI\n *\n * @param subjectType - Which mapping to use: Table 2 for legal persons, Table 4 for natural persons\n */\nexport function getIdentifierPrefix(typeUri: string, subjectType: 'legal' | 'natural' = 'legal'): string | undefined {\n return subjectType === 'legal'\n ? LEGAL_PERSON_IDENTIFIER_PREFIXES[typeUri]\n : NATURAL_PERSON_IDENTIFIER_PREFIXES[typeUri]\n}\n","/**\n * WRPRC Zod Schemas\n *\n * Zod schemas for ETSI TS 119 475 (Wallet-Relying Party Registration Certificates).\n * Types are derived from these schemas via z.infer<>.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\nimport { z } from 'zod'\n\n// ============================================================================\n// Multilingual Value Schemas\n// ============================================================================\n\n/**\n * Multilingual string schema (B.2.6 Class MultiLangString)\n */\nexport const MultiLangStringSchema = z.object({\n /** Language code per BCP47/RFC 5646 */\n lang: z.string().min(2),\n /** Localized string value */\n value: z.string().min(1),\n})\n\n// ============================================================================\n// Identity Schemas\n// ============================================================================\n\n/**\n * Supervisory Authority schema for Data Protection Authority\n */\nexport const SupervisoryAuthoritySchema = z.object({\n /** Email address of the Data Protection Authority */\n email: z.email().optional(),\n /** Telephone number of the Data Protection Authority */\n phone: z.string().optional(),\n /** URL of web form provided by the Data Protection Authority */\n uri: z.url().optional(),\n})\n\n/**\n * Claim schema for credential attribute specification (B.2.10 Class Claim).\n *\n * `path` follows the DCQL claims path pointer: string for an object key, integer for an\n * array index, null to select every element of an array.\n */\nexport const ClaimSchema = z.object({\n /** Path pointer that specifies the path to a claim within the Credential */\n path: z.array(z.union([z.string(), z.number().int(), z.null()])).min(1),\n /** Array of expected values of the claim */\n values: z.array(z.union([z.string(), z.number(), z.boolean()])).optional(),\n})\n\n/**\n * Credential schema for attestations (B.2.9 Class Credential).\n *\n * The subfield is named `claim` (singular) even though it holds an array. This follows\n * ETSI TS 119 475 v1.2.1 Tables 8 and 9 and Annex C verbatim; see the package README.\n */\nexport const CredentialSchema = z.object({\n /** Format of the attestation (e.g., \"dc+sd-jwt\", \"mso_mdoc\") */\n format: z.string().min(1),\n /** Object defining additional properties per Credential Format */\n meta: z.record(z.string(), z.unknown()),\n /** Array of claim objects specifying requestable attributes */\n claim: z.array(ClaimSchema).optional(),\n})\n\n/** Credential issued by the WRP for `provides_attestations` (Table 8) */\nexport const ProvidedAttestationSchema = CredentialSchema.omit({ claim: true }).strict()\n\n/**\n * Status list reference for certificate validity\n */\nexport const StatusListSchema = z.object({\n /** Index in the status list */\n idx: z.number().int().nonnegative(),\n /** URI to the status list */\n uri: z.url(),\n})\n\n/**\n * Status schema for WRPRC validity\n */\nexport const StatusSchema = z.object({\n status_list: StatusListSchema,\n})\n\n/**\n * Intermediary information when WRP acts through an intermediary (Table 10).\n * The intermediary's semantic identifier comes from its own WRPAC.\n *\n * The common name subfield is `sname` per the normative Table 10. The informative\n * Annex C example spells it `name`; see the package README.\n */\nexport const IntermediarySchema = z.object({\n /** Semantic identifier of the intermediary (from the intermediary's WRPAC) */\n sub: z.string().min(1),\n /** Common name of the intermediary */\n sname: z.string().min(1),\n})\n\n// ============================================================================\n// WRPRC Payload Schema\n// ============================================================================\n\n/**\n * WRPRC Payload schema according to ETSI TS 119 475 clause 5.2.4\n */\nexport const WRPRCPayloadSchema = z.object({\n /** The subject trade name of the WRPRC (B.2.1 tradeName) */\n name: z.string().min(1),\n\n /** Legal name for legal person (B.2.3 legalName) */\n sub_ln: z.string().optional(),\n\n /** Given name for natural person (B.2.4 givenName) */\n sub_gn: z.string().optional(),\n\n /** Family name for natural person (B.2.4 familyName) */\n sub_fn: z.string().optional(),\n\n /** WRP identifier following semantic identifier rules */\n sub: z.string().min(1),\n\n /** Country code (ISO 3166-1 Alpha-2) */\n country: z.string().length(2),\n\n /** URL pointing to the national registry API endpoint */\n registry_uri: z.url(),\n\n /** Descriptions of the services provided by the WRP (array of arrays of localized values) */\n srv_description: z.array(z.array(MultiLangStringSchema)).optional(),\n\n /** List of entitlements assigned to the WRP (Annex A.2 URI or OID form) */\n entitlements: z.array(z.string().min(1)).min(1),\n\n /** URL to the WRP's privacy policy */\n privacy_policy: z.url().optional(),\n\n /** URL general-purpose web address */\n info_uri: z.url().optional(),\n\n /** URL or email for data deletion/portability requests */\n support_uri: z.url().or(z.email()).optional(),\n\n /** Data Protection Authority supervising the WRP */\n supervisory_authority: SupervisoryAuthoritySchema.optional(),\n\n /** Policy identifier as defined in clause 6.1.3 */\n policy_id: z.array(z.string()).optional(),\n\n /** URL to the certificate policy and practice statement */\n certificate_policy: z.url().optional(),\n\n /**\n * Unique identifier of this WRPRC (RFC 7519 `jti`).\n *\n * Not listed in ETSI TS 119 475, which leaves the certificate without an identifier\n * to reference it by. Optional so that WRPRCs issued without one still validate.\n */\n jti: z.string().min(1).optional(),\n\n /** Issuance time as a Unix timestamp (Table 7) */\n iat: z.number().int().positive(),\n\n /** Status list for WRPRC validity */\n status: StatusSchema.optional(),\n\n /** Purpose of the intended data processing (localized values) */\n purpose: z.array(MultiLangStringSchema).optional(),\n\n /** Set of credentials intended to be requested by the WRP */\n credentials: z.array(CredentialSchema).optional(),\n\n /**\n * Set of credentials issued by the WRP (for attestation providers, Table 8).\n * These entries contain only `format` and `meta`; claim queries are not present.\n */\n provides_attestations: z.array(ProvidedAttestationSchema).optional(),\n\n /** Intermediary information when WRP acts through an intermediary (Table 10) */\n intermediary: IntermediarySchema.optional(),\n\n /** Whether the WRP is a public sector body (Table 10) */\n public_body: z.boolean().optional(),\n\n /** Expiry as a Unix timestamp; at most 12 months after `iat` (Table 10, GEN-5.2.4-08) */\n exp: z.number().int().positive().optional(),\n\n /** Identifier of the intended use, present only if provided by the registry (Table 9) */\n intended_use_id: z.string().min(1).optional(),\n})\n\n// ============================================================================\n// WRPRC Header Schemas\n// ============================================================================\n\n/**\n * Signature algorithms permitted for JAdES B-B signatures (ETSI TS 119 182-1 clause 5.1.2),\n * referenced by GEN-5.2.1-04.\n */\nexport const WRPRC_JWS_ALGORITHMS = [\n 'ES256',\n 'ES384',\n 'ES512',\n 'PS256',\n 'PS384',\n 'PS512',\n 'RS256',\n 'RS384',\n 'RS512',\n 'EdDSA',\n] as const\n\n/**\n * JWT Header schema according to ETSI TS 119 475 clause 5.2.2 (Table 5).\n *\n * Table 5 lists `typ`, `alg` and `x5c` as the minimum set. GEN-5.2.1-04 additionally\n * requires a JAdES B-B signature, whose protected header carries `iat` as the claimed\n * signing time (ETSI TS 119 182-1 clause 5.1.9). The informative Annex C header omits it.\n */\nexport const WRPRCJWTHeaderSchema = z.object({\n /** Type of the Web Token - must be \"rc-wrp+jwt\" for JWT */\n typ: z.literal('rc-wrp+jwt'),\n /** Algorithm used to sign the JWT */\n alg: z.enum(WRPRC_JWS_ALGORITHMS),\n /** Certificate chain to verify the JWT */\n x5c: z.array(z.string()).min(1),\n /** Key ID */\n kid: z.string().optional(),\n /** JAdES claimed signing time as a Unix timestamp */\n iat: z.number().int().positive(),\n})\n\n/**\n * CWT Header schema according to ETSI TS 119 475 clause 5.2.3 (Table 6).\n *\n * GEN-5.2.1-05 requires an advanced electronic signature per RFC 9052 and RFC 9360\n * rather than a JAdES profile, so no claimed signing time is imposed here.\n */\nexport const WRPRCCWTHeaderSchema = z.object({\n /** Type of the Web Token - must be \"rc-wrp+cwt\" for CWT */\n typ: z.literal('rc-wrp+cwt'),\n /** Algorithm used to sign the CWT per RFC 9052 */\n alg: z.number().int(),\n /** Certificate chain to verify the CWT per RFC 9360 */\n x5chain: z.array(z.instanceof(Uint8Array)).min(1),\n /** Unix timestamp indicating when the WRPRC was issued (payload field, not in Table 6) */\n iat: z.number().int().positive().optional(),\n})\n\n// ============================================================================\n// Complete WRPRC Document Schemas\n// ============================================================================\n\n/**\n * Complete JWT WRPRC schema\n */\nexport const WRPRCJWTSchema = z.object({\n header: WRPRCJWTHeaderSchema,\n payload: WRPRCPayloadSchema,\n})\n\n/**\n * Complete CWT WRPRC schema\n */\nexport const WRPRCCWTSchema = z.object({\n header: WRPRCCWTHeaderSchema,\n payload: WRPRCPayloadSchema,\n})\n\n// ============================================================================\n// Legal Person Subject Schema (for validation)\n// ============================================================================\n\n/**\n * Schema for legal person WRPRC subject\n */\nexport const LegalPersonSubjectSchema = WRPRCPayloadSchema.extend({\n sub_ln: z.string().min(1),\n}).omit({\n sub_gn: true,\n sub_fn: true,\n})\n\n/**\n * Schema for natural person WRPRC subject\n */\nexport const NaturalPersonSubjectSchema = WRPRCPayloadSchema.extend({\n sub_gn: z.string().min(1),\n sub_fn: z.string().min(1),\n}).omit({\n sub_ln: true,\n})\n","import { IdentityException } from '@owf/identity-common'\n\n/**\n * WRPRCException is a custom error class for WRPRC-related exceptions.\n */\nexport class WRPRCException extends IdentityException {\n constructor(message: string, details?: unknown) {\n super(message, details)\n Object.setPrototypeOf(this, WRPRCException.prototype)\n this.name = 'WRPRCException'\n }\n}\n","/**\n * WRPRC Builders\n *\n * Fluent builders for creating ETSI TS 119 475 Wallet-Relying Party Registration Certificates.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\nimport { dateToSeconds, nowInSeconds } from '@owf/identity-common'\nimport type { z } from 'zod'\nimport { ENTITLEMENT_SERVICE_PROVIDER, type WRP_ENTITLEMENTS } from './entitlements'\nimport { WRPRCPayloadSchema } from './schemas'\nimport type {\n Claim,\n Credential,\n Intermediary,\n LegalPersonWRPRCInput,\n MultiLangString,\n NaturalPersonWRPRCInput,\n ProvidedAttestation,\n Status,\n SupervisoryAuthority,\n WRPRCPayload,\n} from './types'\nimport { WRPRCException } from './wrprc-exception'\n\n// ============================================================================\n// Partial Payload Type\n// ============================================================================\n\ntype PartialWRPRCPayload = Partial<z.input<typeof WRPRCPayloadSchema>>\n\n// ============================================================================\n// WRPRC Payload Builder\n// ============================================================================\n\n/**\n * Builder for creating WRPRC payloads with a fluent API\n */\nexport class WRPRCBuilder {\n private payload: PartialWRPRCPayload = {}\n\n /**\n * Set the trade name (display name) of the WRP\n */\n name(value: string): this {\n this.payload.name = value\n return this\n }\n\n /**\n * Set the legal name for a legal person WRP\n */\n legalName(value: string): this {\n this.payload.sub_ln = value\n return this\n }\n\n /**\n * Set the given name for a natural person WRP\n */\n givenName(value: string): this {\n this.payload.sub_gn = value\n return this\n }\n\n /**\n * Set the family name for a natural person WRP\n */\n familyName(value: string): this {\n this.payload.sub_fn = value\n return this\n }\n\n /**\n * Set the WRP identifier (semantic identifier)\n *\n * @param identifier - The semantic identifier following ETSI EN 319 412-1\n * Format: PREFIX (3 chars) + COUNTRY (2 chars) + \"-\" + ID\n * Examples: \"LEIXG-529900T8BM49AURSDO55\", \"TINIT-RSSMRA85T10A562S\"\n */\n identifier(identifier: string): this {\n this.payload.sub = identifier\n return this\n }\n\n /**\n * Set the country code (ISO 3166-1 Alpha-2)\n */\n country(code: string): this {\n this.payload.country = code\n return this\n }\n\n /**\n * Set the URL to the national registry API endpoint\n */\n registryUri(uri: string): this {\n this.payload.registry_uri = uri\n return this\n }\n\n /**\n * Add a service description in a specific language.\n *\n * `srv_description` is an array of services, each localized into one or more languages\n * (B.2.1). Consecutive calls localize the same service; repeating a language starts the\n * next one.\n */\n serviceDescription(description: string, lang = 'en'): this {\n const groups = this.payload.srv_description ?? []\n this.payload.srv_description = groups\n const current = groups[groups.length - 1]\n if (current && !current.some((entry) => entry.lang === lang)) {\n current.push({ lang, value: description })\n } else {\n groups.push([{ lang, value: description }])\n }\n return this\n }\n\n /**\n * Add multiple service descriptions (one array per service, with multiple languages)\n */\n addServiceDescriptions(descriptions: MultiLangString[]): this {\n this.payload.srv_description = this.payload.srv_description ?? []\n this.payload.srv_description.push(descriptions)\n return this\n }\n\n /**\n * Add an entitlement\n *\n * @param entitlement - The entitlement URI or key from WRP_ENTITLEMENTS\n */\n addEntitlement(entitlement: string | (typeof WRP_ENTITLEMENTS)[keyof typeof WRP_ENTITLEMENTS]): this {\n this.payload.entitlements = this.payload.entitlements ?? []\n if (!this.payload.entitlements.includes(entitlement)) {\n this.payload.entitlements.push(entitlement)\n }\n return this\n }\n\n /**\n * Set all entitlements (replaces existing)\n */\n entitlements(entitlements: string[]): this {\n this.payload.entitlements = [...entitlements]\n return this\n }\n\n /**\n * Set the privacy policy URL\n */\n privacyPolicy(uri: string): this {\n this.payload.privacy_policy = uri\n return this\n }\n\n /**\n * Set the info URI (general-purpose web address)\n */\n infoUri(uri: string): this {\n this.payload.info_uri = uri\n return this\n }\n\n /**\n * Set the support URI for data requests\n */\n supportUri(uri: string): this {\n this.payload.support_uri = uri\n return this\n }\n\n /**\n * Set the supervisory authority (Data Protection Authority)\n */\n supervisoryAuthority(authority: SupervisoryAuthority): this {\n this.payload.supervisory_authority = authority\n return this\n }\n\n /**\n * Set the policy ID(s)\n */\n policyId(ids: string[]): this {\n this.payload.policy_id = ids\n return this\n }\n\n /**\n * Set the certificate policy URL\n */\n certificatePolicy(uri: string): this {\n this.payload.certificate_policy = uri\n return this\n }\n\n /**\n * Set the unique identifier of the certificate (`jti`)\n * If not set, the payload carries no identifier\n *\n * @param id - Identifier from the issuing registry's own scheme.\n */\n certificateId(id: string): this {\n this.payload.jti = id\n return this\n }\n\n /**\n * Set the issued-at timestamp (Unix timestamp)\n * If not set, will default to current time when building\n */\n issuedAt(timestamp: number | Date): this {\n this.payload.iat = typeof timestamp === 'number' ? timestamp : dateToSeconds(timestamp)\n return this\n }\n\n /**\n * Set the status reference for certificate validity\n */\n status(status: Status): this {\n this.payload.status = status\n return this\n }\n\n /**\n * Add a purpose description\n */\n addPurpose(description: string, lang = 'en'): this {\n this.payload.purpose = this.payload.purpose ?? []\n this.payload.purpose.push({ lang, value: description })\n return this\n }\n\n /**\n * Set all purposes (replaces existing)\n */\n purposes(purposes: MultiLangString[]): this {\n this.payload.purpose = purposes\n return this\n }\n\n /**\n * Add a credential that the WRP intends to request\n */\n addCredential(credential: Credential): this {\n this.payload.credentials = this.payload.credentials ?? []\n this.payload.credentials.push(credential)\n return this\n }\n\n /**\n * Add a credential issued by the WRP (Table 8, `provides_attestations`).\n */\n addProvidedAttestation(attestation: ProvidedAttestation): this {\n this.payload.provides_attestations = this.payload.provides_attestations ?? []\n this.payload.provides_attestations.push(attestation)\n return this\n }\n\n /**\n * Set intermediary information\n */\n intermediary(intermediary: Intermediary): this {\n this.payload.intermediary = intermediary\n return this\n }\n\n /**\n * Mark the WRP as a public sector body (Table 10)\n */\n publicBody(value: boolean): this {\n this.payload.public_body = value\n return this\n }\n\n /**\n * Set the expiry timestamp (Table 10); must be at most 12 months after iat\n */\n expiresAt(timestamp: number | Date): this {\n this.payload.exp = typeof timestamp === 'number' ? timestamp : dateToSeconds(timestamp)\n return this\n }\n\n /**\n * Set the intended-use identifier, used to fetch the intended use from the registry (Table 9)\n */\n intendedUseId(id: string): this {\n this.payload.intended_use_id = id\n return this\n }\n\n /**\n * Build the WRPRC payload\n *\n * @throws WRPRCException if the payload is invalid\n */\n build(): WRPRCPayload {\n // Set default iat if not provided\n if (!this.payload.iat) {\n this.payload.iat = nowInSeconds()\n }\n\n const result = WRPRCPayloadSchema.safeParse(this.payload)\n\n if (!result.success) {\n const messages = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('\\n')\n throw new WRPRCException(`Invalid WRPRC payload:\\n${messages}`, result.error.issues)\n }\n\n return result.data\n }\n}\n\n// ============================================================================\n// Credential Builder\n// ============================================================================\n\n/**\n * Builder for creating Credential objects\n */\nexport class CredentialBuilder {\n private credential: Partial<Credential> = {}\n\n /**\n * Set the credential format\n *\n * @param format - The format identifier (e.g., \"dc+sd-jwt\", \"mso_mdoc\")\n */\n format(format: string): this {\n this.credential.format = format\n return this\n }\n\n /**\n * Set the credential metadata\n *\n * @param meta - Metadata object per credential format specification\n */\n meta(meta: Record<string, unknown>): this {\n this.credential.meta = meta\n return this\n }\n\n /**\n * Set SD-JWT credential metadata (vct_values)\n */\n sdJwtMeta(vctValues: string[]): this {\n this.credential.format = 'dc+sd-jwt'\n this.credential.meta = { vct_values: vctValues }\n return this\n }\n\n /**\n * Set mDL/mDoc credential metadata (doctype_value)\n */\n mdocMeta(doctypeValue: string): this {\n this.credential.format = 'mso_mdoc'\n this.credential.meta = { doctype_value: doctypeValue }\n return this\n }\n\n /**\n * Add a claim to request\n */\n addClaim(claim: Claim): this {\n this.credential.claim = this.credential.claim ?? []\n this.credential.claim.push(claim)\n return this\n }\n\n /**\n * Add a simple path claim. Use an integer for an array index and null to select\n * every element of an array, per the DCQL claims path pointer.\n */\n addPathClaim(...path: (string | number | null)[]): this {\n this.credential.claim = this.credential.claim ?? []\n this.credential.claim.push({ path })\n return this\n }\n\n /**\n * Build the Credential object\n */\n build(): Credential {\n if (!this.credential.format) {\n throw new WRPRCException('Credential format is required')\n }\n if (!this.credential.meta) {\n throw new WRPRCException('Credential meta is required')\n }\n return this.credential as Credential\n }\n}\n\n// ============================================================================\n// Factory Functions\n// ============================================================================\n\n/**\n * Create a new WRPRCBuilder\n */\nexport function wrprc(): WRPRCBuilder {\n return new WRPRCBuilder()\n}\n\n/**\n * Create a new CredentialBuilder\n */\nexport function credential(): CredentialBuilder {\n return new CredentialBuilder()\n}\n\n/**\n * Create a WRPRC payload for a legal person\n */\nexport function createLegalPersonWRPRC(input: LegalPersonWRPRCInput): WRPRCPayload {\n return wrprc()\n .name(input.name)\n .legalName(input.legalName)\n .identifier(input.identifier)\n .country(input.country)\n .registryUri(input.registryUri)\n .entitlements(input.entitlements)\n .build()\n}\n\n/**\n * Create a WRPRC payload for a natural person\n */\nexport function createNaturalPersonWRPRC(input: NaturalPersonWRPRCInput): WRPRCPayload {\n return wrprc()\n .name(input.name)\n .givenName(input.givenName)\n .familyName(input.familyName)\n .identifier(input.identifier)\n .country(input.country)\n .registryUri(input.registryUri)\n .entitlements(input.entitlements)\n .build()\n}\n\n/**\n * Create a simple service provider WRPRC\n */\nexport function createServiceProviderWRPRC(\n name: string,\n legalName: string,\n identifier: string,\n country: string,\n registryUri: string\n): WRPRCPayload {\n return wrprc()\n .name(name)\n .legalName(legalName)\n .identifier(identifier)\n .country(country)\n .registryUri(registryUri)\n .addEntitlement(ENTITLEMENT_SERVICE_PROVIDER)\n .build()\n}\n","/**\n * WRPRC wire dialects\n *\n * ETSI TS 119 475 v1.2.1 names the array of claim queries `claim` and the intermediary\n * common name `sname`. Both read as editorial defects that a later edition is expected to\n * correct. Parsing accepts either spelling; serialization emits the published edition\n * unless a dialect is chosen explicitly.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\nimport type { WRPRCPayload } from './types'\n\n/**\n * Wire dialects understood by this package.\n */\nexport const WRPRC_DIALECTS = {\n /** ETSI TS 119 475 v1.2.1 as published. The default for everything this package emits. */\n CURRENT: 'ts119475-1.2.1',\n /**\n * Anticipated corrections: `claims` instead of `claim`, `intermediary.name` instead of\n * `intermediary.sname`.\n *\n * Unstable. No published edition defines this yet, so a certificate emitted in this\n * dialect may match neither the current specification nor its eventual correction.\n */\n DRAFT: 'draft',\n} as const\n\n/** A wire dialect understood by this package */\nexport type WRPRCDialect = (typeof WRPRC_DIALECTS)[keyof typeof WRPRC_DIALECTS]\n\ntype Record_ = Record<string, unknown>\n\nfunction isRecord(value: unknown): value is Record_ {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Rename a key, leaving the value alone if the target name is already taken. */\nfunction renameKey(value: unknown, from: string, to: string): unknown {\n if (!isRecord(value) || !(from in value) || to in value) return value\n const { [from]: moved, ...rest } = value\n return { ...rest, [to]: moved }\n}\n\nfunction renameInCredentials(value: unknown, from: string, to: string): unknown {\n if (!Array.isArray(value)) return value\n return value.map((entry) => renameKey(entry, from, to))\n}\n\nfunction mapPayload(payload: unknown, claimFrom: string, claimTo: string, nameFrom: string, nameTo: string): unknown {\n if (!isRecord(payload)) return payload\n const result: Record_ = { ...payload }\n if ('credentials' in result) {\n result.credentials = renameInCredentials(result.credentials, claimFrom, claimTo)\n }\n if ('intermediary' in result) {\n result.intermediary = renameKey(result.intermediary, nameFrom, nameTo)\n }\n return result\n}\n\n/**\n * Accept the anticipated `claims` and `intermediary.name` spellings when parsing, so a\n * certificate from an SDK that already applies the corrections still validates.\n */\nexport function normalizeWRPRCPayload(payload: unknown): unknown {\n return mapPayload(payload, 'claims', 'claim', 'name', 'sname')\n}\n\n/**\n * Serialize a canonical payload in the requested dialect.\n */\nexport function toWRPRCDialect(payload: WRPRCPayload, dialect: WRPRCDialect): unknown {\n if (dialect === WRPRC_DIALECTS.CURRENT) return payload\n return mapPayload(payload, 'claim', 'claims', 'sname', 'name')\n}\n","/**\n * WRPRC Validator\n *\n * Validation functions for ETSI TS 119 475 Wallet-Relying Party Registration Certificates.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\nimport { secondsToDate } from '@owf/identity-common'\nimport { normalizeWRPRCPayload } from './dialect'\nimport { ALL_ENTITLEMENTS, ALL_PSP_SUB_ENTITLEMENTS, ATTESTATION_PROVIDER_ENTITLEMENTS } from './entitlements'\nimport {\n LegalPersonSubjectSchema,\n NaturalPersonSubjectSchema,\n WRPRCJWTHeaderSchema,\n WRPRCPayloadSchema,\n} from './schemas'\nimport type { WRPRCPayload } from './types'\nimport { WRPRCException } from './wrprc-exception'\n\n// ============================================================================\n// Validation Result Types\n// ============================================================================\n\n/**\n * Codes for the semantic checks this validator performs, beyond schema parsing.\n *\n * Exposed so a calling application can branch on a specific failure rather than\n * matching on message text. Requirement identifiers from ETSI TS 119 475 v1.2.1\n * are given where a code maps to one.\n */\nexport const WRPRC_VALIDATION_CODES = {\n /** No entitlement present (GEN-5.2.4-03) */\n MISSING_ENTITLEMENT: 'missing_entitlement',\n /** Sub-entitlement present without its base entitlement (GEN-5.2.4-04) */\n MISSING_BASE_ENTITLEMENT: 'missing_base_entitlement',\n /** Entitlement outside Annex A, which may be a national or EU extension */\n UNKNOWN_ENTITLEMENT: 'unknown_entitlement',\n /** Attestation provider without provides_attestations (GEN-5.2.4-05) */\n MISSING_PROVIDES_ATTESTATIONS: 'missing_provides_attestations',\n /** Service provider without credentials (GEN-5.2.4-06, Table 9) */\n MISSING_CREDENTIALS: 'missing_credentials',\n /** Service provider without purpose (GEN-5.2.4-06, Table 9) */\n MISSING_PURPOSE: 'missing_purpose',\n /** sub does not follow the semantic identifier format of clause 5.1 */\n INVALID_SEMANTIC_IDENTIFIER: 'invalid_semantic_identifier',\n /** sub uses initial characters outside Tables 2 and 4, which may be a national scheme */\n UNKNOWN_IDENTIFIER_PREFIX: 'unknown_identifier_prefix',\n /** sub parses but deviates from the expected identifier shape */\n IDENTIFIER_FORMAT_WARNING: 'identifier_format_warning',\n /** exp more than 12 months after iat (GEN-5.2.4-08) */\n EXP_TOO_LATE: 'exp_too_late',\n /** exp at or before iat */\n EXP_BEFORE_IAT: 'exp_before_iat',\n /** Selected WRPRC identity does not match the access certificate subject */\n ACCESS_CERTIFICATE_IDENTITY_MISMATCH: 'access_certificate_identity_mismatch',\n} as const\n\n/** A semantic validation code emitted by this validator */\nexport type WRPRCValidationCode = (typeof WRPRC_VALIDATION_CODES)[keyof typeof WRPRC_VALIDATION_CODES]\n\n/**\n * A single validation error\n */\nexport interface ValidationError {\n /** Path to the invalid field */\n path: string[]\n /** Error message */\n message: string\n /**\n * Error code. Either a `WRPRCValidationCode` from the semantic checks, or a zod issue\n * code forwarded from schema parsing, so the string stays open for the latter.\n */\n code: WRPRCValidationCode | (string & {})\n}\n\n/**\n * Result of WRPRC validation\n */\nexport interface ValidationResult {\n /** Whether the WRPRC is valid */\n valid: boolean\n /** List of validation errors (empty if valid) */\n errors: ValidationError[]\n /** Warnings that don't invalidate the certificate but should be noted */\n warnings: ValidationError[]\n}\n\n// ============================================================================\n// Core Validation Functions\n// ============================================================================\n\n/**\n * Entitlement-driven checks: GEN-5.2.4-03 to GEN-5.2.4-06.\n */\nfunction validateEntitlementRequirements(\n payload: WRPRCPayload,\n errors: ValidationError[],\n warnings: ValidationError[]\n): void {\n for (const entitlement of payload.entitlements) {\n const known =\n ALL_ENTITLEMENTS.includes(entitlement as (typeof ALL_ENTITLEMENTS)[number]) ||\n ALL_PSP_SUB_ENTITLEMENTS.includes(entitlement as (typeof ALL_PSP_SUB_ENTITLEMENTS)[number])\n if (!known) {\n warnings.push({\n path: ['entitlements'],\n message: `Unknown entitlement URI: ${entitlement}. This may be a national or EU-defined extension.`,\n code: WRPRC_VALIDATION_CODES.UNKNOWN_ENTITLEMENT,\n })\n }\n }\n\n // GEN-5.2.4-03: At least one entitlement must be specified\n if (payload.entitlements.length === 0) {\n errors.push({\n path: ['entitlements'],\n message: 'At least one entitlement must be specified (GEN-5.2.4-03)',\n code: WRPRC_VALIDATION_CODES.MISSING_ENTITLEMENT,\n })\n }\n\n const hasSubEntitlement = payload.entitlements.some((e) =>\n ALL_PSP_SUB_ENTITLEMENTS.includes(e as (typeof ALL_PSP_SUB_ENTITLEMENTS)[number])\n )\n const hasServiceProvider = payload.entitlements.includes('https://uri.etsi.org/19475/Entitlement/Service_Provider')\n\n // GEN-5.2.4-04: If sub-entitlements are present, a base entitlement must also be present\n if (hasSubEntitlement && !hasServiceProvider) {\n errors.push({\n path: ['entitlements'],\n message: 'Service provider sub-entitlements require Service_Provider entitlement (GEN-5.2.4-04)',\n code: WRPRC_VALIDATION_CODES.MISSING_BASE_ENTITLEMENT,\n })\n }\n\n // GEN-5.2.4-05: Attestation providers should have provides_attestations\n const hasAttestationProviderRole = payload.entitlements.some((e) =>\n ATTESTATION_PROVIDER_ENTITLEMENTS.includes(e as (typeof ATTESTATION_PROVIDER_ENTITLEMENTS)[number])\n )\n if (hasAttestationProviderRole && !payload.provides_attestations) {\n warnings.push({\n path: ['provides_attestations'],\n message:\n 'Attestation providers should include provides_attestations field (GEN-5.2.4-05). This is recommended but not required.',\n code: WRPRC_VALIDATION_CODES.MISSING_PROVIDES_ATTESTATIONS,\n })\n }\n\n // GEN-5.2.4-06: service providers carry the intended use fields of Table 9. The registry\n // may not have provided them, so these are warnings rather than errors.\n if (hasServiceProvider && !payload.credentials) {\n warnings.push({\n path: ['credentials'],\n message: 'Service provider WRPRCs should include the credentials field (GEN-5.2.4-06)',\n code: WRPRC_VALIDATION_CODES.MISSING_CREDENTIALS,\n })\n }\n if (hasServiceProvider && !payload.purpose) {\n warnings.push({\n path: ['purpose'],\n message: 'Service provider WRPRCs should include the purpose field (GEN-5.2.4-06)',\n code: WRPRC_VALIDATION_CODES.MISSING_PURPOSE,\n })\n }\n}\n\n/**\n * Validate a WRPRC payload against the schema and semantic rules.\n *\n * @param accessCertificateSub Required subject from the presented access certificate.\n */\nexport function validateWRPRCPayload(payload: unknown, accessCertificateSub: string): ValidationResult {\n const result = WRPRCPayloadSchema.safeParse(normalizeWRPRCPayload(payload))\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n path: issue.path.map(String),\n message: issue.message,\n code: issue.code,\n })\n }\n return { valid: false, errors, warnings }\n }\n\n // Additional semantic validations\n const validPayload: WRPRCPayload = result.data\n\n validateEntitlementRequirements(validPayload, errors, warnings)\n\n // Validate subject identifier format (semantic identifier)\n const subResult = validateSemanticIdentifier(validPayload.sub)\n if (!subResult.valid) {\n errors.push({\n path: ['sub'],\n message: subResult.message,\n code: WRPRC_VALIDATION_CODES.INVALID_SEMANTIC_IDENTIFIER,\n })\n } else if (subResult.unknownPrefix) {\n warnings.push({\n path: ['sub'],\n message: `Unknown semantic identifier initial characters: ${subResult.unknownPrefix}. This may be a national scheme (ETSI EN 319 412-1).`,\n code: WRPRC_VALIDATION_CODES.UNKNOWN_IDENTIFIER_PREFIX,\n })\n }\n\n // GEN-5.2.4-08: exp must be at most 12 months after iat\n if (typeof validPayload.exp === 'number') {\n const maxExp = secondsToDate(validPayload.iat)\n maxExp.setUTCFullYear(maxExp.getUTCFullYear() + 1)\n if (secondsToDate(validPayload.exp) > maxExp) {\n errors.push({\n path: ['exp'],\n message: 'exp must be at most 12 months after iat (GEN-5.2.4-08)',\n code: WRPRC_VALIDATION_CODES.EXP_TOO_LATE,\n })\n }\n if (validPayload.exp <= validPayload.iat) {\n errors.push({\n path: ['exp'],\n message: 'exp must be after iat',\n code: WRPRC_VALIDATION_CODES.EXP_BEFORE_IAT,\n })\n }\n }\n\n // The intermediary identity replaces the WRPRC subject for this cross-certificate check.\n const expectedAccessCertificateSub = validPayload.intermediary?.sub ?? validPayload.sub\n const identityPath = validPayload.intermediary ? ['intermediary', 'sub'] : ['sub']\n if (accessCertificateSub !== expectedAccessCertificateSub) {\n errors.push({\n path: identityPath,\n message: `${validPayload.intermediary ? 'intermediary.sub' : 'sub'} must match the access certificate subject`,\n code: WRPRC_VALIDATION_CODES.ACCESS_CERTIFICATE_IDENTITY_MISMATCH,\n })\n }\n\n return { valid: errors.length === 0, errors, warnings }\n}\n\n/**\n * Validate a JWT header for WRPRC\n */\nexport function validateWRPRCJWTHeader(header: unknown): ValidationResult {\n const result = WRPRCJWTHeaderSchema.safeParse(header)\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n path: issue.path.map(String),\n message: issue.message,\n code: issue.code,\n })\n }\n }\n\n return { valid: errors.length === 0, errors, warnings }\n}\n\n/**\n * Validate a complete WRPRC (header + payload)\n */\nexport function validateWRPRC(header: unknown, payload: unknown, accessCertificateSub: string): ValidationResult {\n const headerResult = validateWRPRCJWTHeader(header)\n const payloadResult = validateWRPRCPayload(payload, accessCertificateSub)\n\n const errors = [\n ...headerResult.errors.map((e) => ({ ...e, path: ['header', ...e.path] })),\n ...payloadResult.errors.map((e) => ({ ...e, path: ['payload', ...e.path] })),\n ]\n\n const warnings = [\n ...headerResult.warnings.map((w) => ({ ...w, path: ['header', ...w.path] })),\n ...payloadResult.warnings.map((w) => ({ ...w, path: ['payload', ...w.path] })),\n ]\n\n return { valid: errors.length === 0, errors, warnings }\n}\n\n// ============================================================================\n// Subject Type Validation\n// ============================================================================\n\n/**\n * Check if payload represents a legal person\n */\nexport function isLegalPersonWRPRC(payload: WRPRCPayload): boolean {\n return typeof payload.sub_ln === 'string' && payload.sub_ln.length > 0\n}\n\n/**\n * Check if payload represents a natural person\n */\nexport function isNaturalPersonWRPRC(payload: WRPRCPayload): boolean {\n return (\n typeof payload.sub_gn === 'string' &&\n payload.sub_gn.length > 0 &&\n typeof payload.sub_fn === 'string' &&\n payload.sub_fn.length > 0\n )\n}\n\n/**\n * Validate as legal person WRPRC\n */\nexport function validateLegalPersonWRPRC(payload: unknown): ValidationResult {\n const result = LegalPersonSubjectSchema.safeParse(normalizeWRPRCPayload(payload))\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n path: issue.path.map(String),\n message: issue.message,\n code: issue.code,\n })\n }\n }\n\n // Additional validation for legal person identifier format\n if (result.success) {\n const sub: string = result.data.sub\n // Legal person identifiers should follow ETSI EN 319 412-1 clause 5.1.4\n // Format: 3-character prefix (or national scheme `XX:`) + 2-letter country code + hyphen + identifier\n if (!/^(?:[A-Z]{3}|[A-Z]{2}:)[A-Z]{2}-.+$/.test(sub)) {\n warnings.push({\n path: ['sub'],\n message:\n 'Legal person identifier should follow format: PREFIX + COUNTRY + \"-\" + ID (e.g., \"LEIXG-529900T8BM49AURSDO55\")',\n code: WRPRC_VALIDATION_CODES.IDENTIFIER_FORMAT_WARNING,\n })\n }\n }\n\n return { valid: errors.length === 0, errors, warnings }\n}\n\n/**\n * Validate as natural person WRPRC\n */\nexport function validateNaturalPersonWRPRC(payload: unknown): ValidationResult {\n const result = NaturalPersonSubjectSchema.safeParse(normalizeWRPRCPayload(payload))\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n path: issue.path.map(String),\n message: issue.message,\n code: issue.code,\n })\n }\n }\n\n // Additional validation for natural person identifier format\n if (result.success) {\n const sub: string = result.data.sub\n // Natural person identifiers should follow ETSI EN 319 412-1 clause 5.1.3\n // Format: 3-character prefix (or national scheme `XX:`) + 2-letter country code + hyphen + identifier\n if (!/^(?:[A-Z]{3}|[A-Z]{2}:)[A-Z]{2}-.+$/.test(sub)) {\n warnings.push({\n path: ['sub'],\n message:\n 'Natural person identifier should follow format: PREFIX + COUNTRY + \"-\" + ID (e.g., \"TINIT-RSSMRA85T10A562S\")',\n code: WRPRC_VALIDATION_CODES.IDENTIFIER_FORMAT_WARNING,\n })\n }\n }\n\n return { valid: errors.length === 0, errors, warnings }\n}\n\n// ============================================================================\n// Semantic Identifier Validation\n// ============================================================================\n\n/**\n * Valid semantic identifier initial characters for legal persons\n * (Table 2, ETSI EN 319 412-1 clause 5.1.4)\n */\nconst LEGAL_PERSON_PREFIXES = ['EOR', 'LEI', 'NTR', 'VAT', 'EXC']\n\n/**\n * Valid semantic identifier initial characters for natural persons\n * (Table 4, ETSI EN 319 412-1 clause 5.1.3)\n */\nconst NATURAL_PERSON_PREFIXES = ['TIN', 'PAS', 'IDC', 'PNO']\n\n/**\n * Validate a semantic identifier format\n */\nfunction validateSemanticIdentifier(identifier: string): {\n valid: boolean\n message: string\n unknownPrefix?: string\n} {\n // Format: PREFIX (3 chars, or 2 letters + \":\" for a national scheme, EN 319 412-1 LEG-5.1.4-03 (7)\n // and NAT-5.1.3-03 (7)) + COUNTRY (2 chars) + \"-\" + ID\n const match = identifier.match(/^([A-Z]{3}|[A-Z]{2}:)([A-Z]{2})-(.+)$/)\n\n if (!match) {\n return {\n valid: false,\n message: 'Semantic identifier must follow format: PREFIX (3 chars) + COUNTRY (2 chars) + \"-\" + ID',\n }\n }\n\n const [, prefix] = match\n const known = LEGAL_PERSON_PREFIXES.includes(prefix) || NATURAL_PERSON_PREFIXES.includes(prefix)\n\n // National schemes may define further initial characters, so an unknown one is not an error\n return { valid: true, message: '', ...(known ? {} : { unknownPrefix: prefix }) }\n}\n\n// ============================================================================\n// Assertion Functions\n// ============================================================================\n\n/**\n * Assert that a WRPRC payload is valid, throws WRPRCException if not\n */\nexport function assertValidWRPRCPayload(\n payload: unknown,\n accessCertificateSub: string\n): asserts payload is WRPRCPayload {\n const result = validateWRPRCPayload(payload, accessCertificateSub)\n if (!result.valid) {\n const messages = result.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join('\\n')\n throw new WRPRCException(`Invalid WRPRC payload:\\n${messages}`, result.errors)\n }\n}\n\n/**\n * Parse a WRPRC payload into its canonical form, accepting either dialect spelling.\n *\n * @throws WRPRCException if the payload is invalid\n */\nexport function parseWRPRCPayload(payload: unknown, accessCertificateSub: string): WRPRCPayload {\n assertValidWRPRCPayload(payload, accessCertificateSub)\n return WRPRCPayloadSchema.parse(normalizeWRPRCPayload(payload))\n}\n\n/**\n * Assert that a WRPRC is valid (header + payload), throws WRPRCException if not\n */\nexport function assertValidWRPRC(header: unknown, payload: unknown, accessCertificateSub: string): void {\n const result = validateWRPRC(header, payload, accessCertificateSub)\n if (!result.valid) {\n const messages = result.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join('\\n')\n throw new WRPRCException(`Invalid WRPRC:\\n${messages}`, result.errors)\n }\n}\n","/**\n * WRPRC Signer\n *\n * Functions for creating and signing ETSI TS 119 475 Wallet-Relying Party Registration Certificates.\n *\n * GEN-5.2.1-04 requires the JWT to carry a JAdES signature with the B-B profile of\n * ETSI TS 119 182-1, so signing and decoding go through `@owf/eudi-jades`.\n *\n * @see https://www.etsi.org/deliver/etsi_ts/119400_119499/119475/01.02.01_60/ts_119475v010201p.pdf\n */\n\nimport { pemToDer } from '@owf/crypto'\nimport { decode, JAdESProfile, Token, validateProfile } from '@owf/eudi-jades'\nimport { toWRPRCDialect, WRPRC_DIALECTS } from './dialect'\nimport type { SignedWRPRC, SignOptions, WRPRCJWTHeader, WRPRCPayload } from './types'\nimport { assertValidWRPRCPayload, parseWRPRCPayload } from './validator'\nimport { WRPRCException } from './wrprc-exception'\n\n// ============================================================================\n// JWT Signing\n// ============================================================================\n\n/**\n * Sign a WRPRC payload into a JAdES B-B signed JWT\n *\n * @param options - Signing options including payload, algorithm, certificates, and signer\n * @returns Signed WRPRC with JWS string and decoded parts\n */\nexport async function signWRPRC(options: SignOptions): Promise<SignedWRPRC> {\n const {\n payload,\n accessCertificateSub,\n algorithm = 'ES256',\n certificates,\n keyId,\n signer,\n signingTime,\n dialect = WRPRC_DIALECTS.CURRENT,\n } = options\n\n // Validate payload\n assertValidWRPRCPayload(payload, accessCertificateSub)\n\n if (!certificates || certificates.length === 0) {\n throw new WRPRCException('At least one certificate is required for x5c header')\n }\n\n // Extract base64 content from PEM certificates\n const x5c = certificates.map((cert) => {\n const content = pemToDer(cert)\n if (!content) {\n throw new WRPRCException('Invalid PEM certificate format')\n }\n return content\n })\n\n const token = new Token(toWRPRCDialect(payload, dialect))\n .setProtectedHeader({ typ: 'rc-wrp+jwt', alg: algorithm, ...(keyId && { kid: keyId }) })\n .setX5c(x5c)\n .setSigningTime(signingTime)\n\n await token.sign(async (data) => signer(data))\n\n return {\n jws: token.toString(),\n header: token.getProtectedHeader() as WRPRCJWTHeader,\n payload,\n }\n}\n\n// ============================================================================\n// JWT Decoding\n// ============================================================================\n\n/**\n * Decode a signed WRPRC JWT (without cryptographic verification)\n *\n * @param jws - The compact JWS string\n * @returns Decoded WRPRC with header and payload\n */\nexport function decodeWRPRC(jws: string, accessCertificateSub: string): SignedWRPRC {\n let decoded: ReturnType<typeof decode<WRPRCPayload>>\n try {\n decoded = decode<WRPRCPayload>(jws)\n } catch (error) {\n throw new WRPRCException(\n `WRPRC signature does not meet the JAdES B-B profile (GEN-5.2.1-04): ${(error as Error).message}`,\n error\n )\n }\n\n // Validate typ header\n if (decoded.header.typ !== 'rc-wrp+jwt') {\n throw new WRPRCException(`Invalid WRPRC type: expected \"rc-wrp+jwt\", got \"${decoded.header.typ}\"`)\n }\n\n // GEN-5.2.1-04\n const profile = validateProfile(decoded.header, JAdESProfile.B_B, decoded.unprotectedHeader)\n if (!profile.valid) {\n throw new WRPRCException(\n `WRPRC signature does not meet the JAdES B-B profile (GEN-5.2.1-04): ${profile.missing?.join(', ')}`\n )\n }\n\n // Validate payload structure\n const payload = parseWRPRCPayload(decoded.payload, accessCertificateSub)\n\n return {\n jws,\n header: decoded.header as WRPRCJWTHeader,\n payload,\n }\n}\n\n/**\n * Parse a WRPRC JWT without validation (for inspection purposes)\n *\n * @param jws - The compact JWS string\n * @returns Decoded parts without validation\n */\nexport function parseWRPRC(jws: string): { header: unknown; payload: unknown; signature: string } {\n const parts = jws.split('.')\n if (parts.length !== 3) {\n throw new WRPRCException('Invalid compact JWS: expected 3 parts')\n }\n const decoded = decode(jws)\n\n return {\n header: decoded.header,\n payload: decoded.payload,\n signature: parts[2],\n }\n}\n\n// ============================================================================\n// WRPRC Creation Helpers\n// ============================================================================\n\n/**\n * Create a WRPRC with automatic timestamp\n *\n * @param payload - Partial payload (iat will be set automatically if not provided)\n * @returns Complete payload with timestamp\n */\nexport function createWRPRCPayload(payload: WRPRCPayload, accessCertificateSub: string): WRPRCPayload {\n assertValidWRPRCPayload(payload, accessCertificateSub)\n\n return payload\n}\n"],"mappings":";;;;;;;;AAgCA,MAAa,+BAA+B;;;;;AAM5C,MAAa,4BAA4B;;;;;AAMzC,MAAa,iCAAiC;;;;;AAM9C,MAAa,+BAA+B;;;;;AAM5C,MAAa,2BAA2B;;;;AAwCxC,MAAa,mBAAmB;CAC9B,kBAAkB;CAClB,eAAe;CACf,oBAAoB;CACpB,kBAAkB;CAClB,cAAc;CACd,0BAA0B;CAC1B,yBAAyB;CACzB,oBAAoB;CACpB,mBAAmB;CACnB,8BAA8B;AAChC;;;;AAKA,MAAa,mBAAmB,OAAO,OAAO,gBAAgB;;;;AAK9D,MAAa,oCAAoC;CAC/C;CACA;CACA;CACA;AACF;;;;;AAUA,MAAa,uBAAuB;;CAElC,mBAAmB;;CAEnB,oBAAoB;;CAEpB,qBAAqB;;CAErB,YAAY;;CAEZ,aAAa;AACf;;;;AAKA,MAAa,2BAA2B,OAAO,OAAO,oBAAoB;;;;AAS1E,MAAa,mBAAmB;;CAE9B,MAAM;;CAEN,KAAK;;CAEL,MAAM;;CAEN,OAAO;;CAEP,KAAK;;CAEL,QAAQ;AACV;;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pC,SAAS,OAAO;EACd,MAAM,IAAI,eACR,uEAAwE,MAAgB,WACxF,KACF;CACF;CAGA,IAAI,QAAQ,OAAO,QAAQ,cACzB,MAAM,IAAI,eAAe,mDAAmD,QAAQ,OAAO,IAAI,EAAE;CAInG,MAAM,UAAU,gBAAgB,QAAQ,QAAQ,aAAa,KAAK,QAAQ,iBAAiB;CAC3F,IAAI,CAAC,QAAQ,OACX,MAAM,IAAI,eACR,uEAAuE,QAAQ,SAAS,KAAK,IAAI,GACnG;CAIF,MAAM,UAAU,kBAAkB,QAAQ,SAAS,oBAAoB;CAEvE,OAAO;EACL;EACA,QAAQ,QAAQ;EAChB;CACF;AACF;;;;;;;AAQA,SAAgB,WAAW,KAAuE;CAChG,MAAM,QAAQ,IAAI,MAAM,GAAG;CAC3B,IAAI,MAAM,WAAW,GACnB,MAAM,IAAI,eAAe,uCAAuC;CAElE,MAAM,UAAU,OAAO,GAAG;CAE1B,OAAO;EACL,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,WAAW,MAAM;CACnB;AACF;;;;;;;AAYA,SAAgB,mBAAmB,SAAuB,sBAA4C;CACpG,wBAAwB,SAAS,oBAAoB;CAErD,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@owf/eudi-registration-certificate",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.2",
4
+ "description": "ETSI TS 119 475 Wallet-Relying Party Registration Certificate (WRPRC) implementation",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "license": "Apache-2.0",
9
+ "exports": "./src/index.ts",
10
+ "homepage": "https://github.com/openwallet-foundation-labs/identity-common-ts/tree/main/packages/eudi-registration-certificate",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/openwallet-foundation-labs/identity-common-ts",
14
+ "directory": "packages/eudi-registration-certificate"
15
+ },
16
+ "keywords": [
17
+ "eudi",
18
+ "wallet",
19
+ "wrprc",
20
+ "registration-certificate",
21
+ "etsi",
22
+ "ts-119-475",
23
+ "relying-party",
24
+ "identity"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.mjs",
30
+ "types": "./dist/index.d.mts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.mts",
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.cjs",
36
+ "default": "./dist/index.mjs"
37
+ },
38
+ "./package.json": "./package.json"
39
+ }
40
+ },
41
+ "scripts": {
42
+ "build": "tsdown src/index.ts --format esm,cjs --dts --sourcemap"
43
+ },
44
+ "dependencies": {
45
+ "@owf/crypto": "workspace:^",
46
+ "@owf/eudi-jades": "workspace:*",
47
+ "@owf/identity-common": "workspace:^",
48
+ "zod": "catalog:"
49
+ }
50
+ }