import { Kms } from "@credo-ts/core"; import { Openid4vciIssuer } from "@openid4vc/openid4vci"; //#region src/shared/models/CredentialHolderBinding.d.ts type VerifiedCredentialRequestAttestationProof = Awaited['verifyCredentialRequestAttestationProof']>>; type VerifiedCredentialRequestJwtProof = Awaited['verifyCredentialRequestJwtProof']>>['keyAttestation']; type OpenId4VcCredentialHolderAttestationBinding = { method: 'attestation'; /** * The key attestation JWT to use to request issuance of the credentials based * on the attested_keys. * * When the `keyAttestationJwt` contains a `nonce` payload value it will be sent * as an `attestation` proof (without signing using a key in the attested key). * NOTE that the `nonce` value must match with the `c_nonce` value from the issuer. * * If no nonce is provided, the `jwt` proof type will be used and the proof will be * signed using the first key from the `attested_keys` array. */ keyAttestationJwt: string; }; interface OpenId4VcCredentialHolderDidBinding { method: 'did'; didUrls: string[]; } interface OpenId4VcCredentialHolderJwkBinding { method: 'jwk'; keys: Kms.PublicJwk[]; } type VerifiedOpenId4VcCredentialHolderBinding = { proofType: 'jwt' | 'attestation'; /** * The key attestation that was provided to attest the keys. * Always defined if `proofType` is `attestation`, as well * as when `key_attestations_required` is defined in the * credential issuer metadata */ keyAttestation?: VerifiedCredentialRequestAttestationProof | VerifiedCredentialRequestJwtProof; /** * The binding method of the keys. * * Binding method `did` is only supported for proof type `jwt`. */ bindingMethod: 'did' | 'jwk'; } & ({ bindingMethod: 'did'; /** * The DIDs that were provided as part of the `jwt` proofs in the credential request */ keys: Array<{ method: 'did'; jwk: Kms.PublicJwk; didUrl: string; }>; } | { bindingMethod: 'jwk'; /** * The keys that were provided as part of the credential request proof. * - If `proofType` is `attestation` these keys were extracted from the signed key attestation, but no proof was signed using one of the attested keys * - If `proofType` is `jwt` and `attestation` is defined, the keys were extracted from the attestation, and proof was signed using one of the attested keys * - Otherwise if `proofType` is `jwt` and no `attestation` is defined, the keys were not attested, and for each individual key a proof was signed using that key. */ keys: Array<{ method: 'jwk'; jwk: Kms.PublicJwk; }>; }); type OpenId4VcCredentialHolderBinding = OpenId4VcCredentialHolderDidBinding | OpenId4VcCredentialHolderJwkBinding | OpenId4VcCredentialHolderAttestationBinding; //#endregion export { OpenId4VcCredentialHolderAttestationBinding, OpenId4VcCredentialHolderBinding, OpenId4VcCredentialHolderDidBinding, OpenId4VcCredentialHolderJwkBinding, VerifiedOpenId4VcCredentialHolderBinding }; //# sourceMappingURL=CredentialHolderBinding.d.mts.map