@credo-ts/anoncreds 0.6.1-pr-2091-20241119140918 → 0.6.1
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.
- package/build/AnonCredsApi.d.mts +113 -0
- package/build/AnonCredsApi.d.mts.map +1 -0
- package/build/AnonCredsApi.mjs +439 -0
- package/build/AnonCredsApi.mjs.map +1 -0
- package/build/AnonCredsApiOptions.d.mts +28 -0
- package/build/AnonCredsApiOptions.d.mts.map +1 -0
- package/build/AnonCredsModule.d.mts +29 -0
- package/build/AnonCredsModule.d.mts.map +1 -0
- package/build/AnonCredsModule.mjs +62 -0
- package/build/AnonCredsModule.mjs.map +1 -0
- package/build/AnonCredsModuleConfig.d.mts +79 -0
- package/build/AnonCredsModuleConfig.d.mts.map +1 -0
- package/build/AnonCredsModuleConfig.mjs +31 -0
- package/build/AnonCredsModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs +203 -0
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsHolderService.mjs +488 -0
- package/build/anoncreds-rs/AnonCredsRsHolderService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs +213 -0
- package/build/anoncreds-rs/AnonCredsRsIssuerService.mjs.map +1 -0
- package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs +122 -0
- package/build/anoncreds-rs/AnonCredsRsVerifierService.mjs.map +1 -0
- package/build/anoncreds-rs/index.mjs +3 -0
- package/build/anoncreds-rs/utils.mjs +60 -0
- package/build/anoncreds-rs/utils.mjs.map +1 -0
- package/build/error/AnonCredsError.d.mts +13 -0
- package/build/error/AnonCredsError.d.mts.map +1 -0
- package/build/error/AnonCredsError.mjs +12 -0
- package/build/error/AnonCredsError.mjs.map +1 -0
- package/build/error/AnonCredsRsError.d.mts +13 -0
- package/build/error/AnonCredsRsError.d.mts.map +1 -0
- package/build/error/AnonCredsRsError.mjs +12 -0
- package/build/error/AnonCredsRsError.mjs.map +1 -0
- package/build/error/AnonCredsStoreRecordError.d.mts +13 -0
- package/build/error/AnonCredsStoreRecordError.d.mts.map +1 -0
- package/build/error/AnonCredsStoreRecordError.mjs +12 -0
- package/build/error/AnonCredsStoreRecordError.mjs.map +1 -0
- package/build/error/index.d.mts +3 -0
- package/build/error/index.mjs +3 -0
- package/build/formats/AnonCredsDidCommCredentialFormat.d.mts +82 -0
- package/build/formats/AnonCredsDidCommCredentialFormat.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts +120 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.mjs +331 -0
- package/build/formats/AnonCredsDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormat.d.mts +77 -0
- package/build/formats/AnonCredsDidCommProofFormat.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormatService.d.mts +93 -0
- package/build/formats/AnonCredsDidCommProofFormatService.d.mts.map +1 -0
- package/build/formats/AnonCredsDidCommProofFormatService.mjs +250 -0
- package/build/formats/AnonCredsDidCommProofFormatService.mjs.map +1 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts +118 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs +587 -0
- package/build/formats/DataIntegrityDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts +38 -0
- package/build/formats/LegacyIndyDidCommCredentialFormat.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts +122 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs +309 -0
- package/build/formats/LegacyIndyDidCommCredentialFormatService.mjs.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormat.d.mts +36 -0
- package/build/formats/LegacyIndyDidCommProofFormat.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.d.mts +98 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.d.mts.map +1 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.mjs +322 -0
- package/build/formats/LegacyIndyDidCommProofFormatService.mjs.map +1 -0
- package/build/formats/index.d.mts +9 -0
- package/build/formats/index.mjs +5 -0
- package/build/index.d.mts +86 -0
- package/build/index.mjs +69 -0
- package/build/models/AnonCredsCredentialProposal.mjs +75 -0
- package/build/models/AnonCredsCredentialProposal.mjs.map +1 -0
- package/build/models/AnonCredsProofRequest.mjs +62 -0
- package/build/models/AnonCredsProofRequest.mjs.map +1 -0
- package/build/models/AnonCredsRequestedAttribute.mjs +50 -0
- package/build/models/AnonCredsRequestedAttribute.mjs.map +1 -0
- package/build/models/AnonCredsRequestedPredicate.mjs +53 -0
- package/build/models/AnonCredsRequestedPredicate.mjs.map +1 -0
- package/build/models/AnonCredsRestriction.d.mts +29 -0
- package/build/models/AnonCredsRestriction.d.mts.map +1 -0
- package/build/models/AnonCredsRestriction.mjs +137 -0
- package/build/models/AnonCredsRestriction.mjs.map +1 -0
- package/build/models/AnonCredsRestrictionWrapper.d.mts +9 -0
- package/build/models/AnonCredsRestrictionWrapper.d.mts.map +1 -0
- package/build/models/AnonCredsRestrictionWrapper.mjs +18 -0
- package/build/models/AnonCredsRestrictionWrapper.mjs.map +1 -0
- package/build/models/AnonCredsRevocationInterval.mjs +27 -0
- package/build/models/AnonCredsRevocationInterval.mjs.map +1 -0
- package/build/models/exchange.d.mts +104 -0
- package/build/models/exchange.d.mts.map +1 -0
- package/build/models/exchange.mjs +11 -0
- package/build/models/exchange.mjs.map +1 -0
- package/build/models/index.d.mts +4 -0
- package/build/models/index.mjs +2 -0
- package/build/models/internal.d.mts +40 -0
- package/build/models/internal.d.mts.map +1 -0
- package/build/models/registry.d.mts +44 -0
- package/build/models/registry.d.mts.map +1 -0
- package/build/models/utils.d.mts +27 -0
- package/build/models/utils.d.mts.map +1 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts +215 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.d.mts.map +1 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs +827 -0
- package/build/protocols/credentials/v1/DidCommCredentialV1Protocol.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs +17 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1AckHandler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs +17 -0
- package/build/protocols/credentials/v1/handlers/DidCommCredentialV1ProblemReportHandler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs +36 -0
- package/build/protocols/credentials/v1/handlers/DidCommIssueCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs +32 -0
- package/build/protocols/credentials/v1/handlers/DidCommOfferCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs +35 -0
- package/build/protocols/credentials/v1/handlers/DidCommProposeCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs +36 -0
- package/build/protocols/credentials/v1/handlers/DidCommRequestCredentialV1Handler.mjs.map +1 -0
- package/build/protocols/credentials/v1/handlers/index.mjs +6 -0
- package/build/protocols/credentials/v1/index.d.mts +9 -0
- package/build/protocols/credentials/v1/index.mjs +9 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts +16 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs +21 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1AckMessage.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts +32 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs +57 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1Preview.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts +16 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs +21 -0
- package/build/protocols/credentials/v1/messages/DidCommCredentialV1ProblemReportMessage.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts +26 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs +46 -0
- package/build/protocols/credentials/v1/messages/DidCommIssueCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts +34 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs +61 -0
- package/build/protocols/credentials/v1/messages/DidCommOfferCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts +64 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs +95 -0
- package/build/protocols/credentials/v1/messages/DidCommProposeCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts +26 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.d.mts.map +1 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs +46 -0
- package/build/protocols/credentials/v1/messages/DidCommRequestCredentialV1Message.mjs.map +1 -0
- package/build/protocols/credentials/v1/messages/index.d.mts +7 -0
- package/build/protocols/credentials/v1/messages/index.mjs +7 -0
- package/build/protocols/index.d.mts +18 -0
- package/build/protocols/index.mjs +18 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts +105 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.d.mts.map +1 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs +723 -0
- package/build/protocols/proofs/v1/DidCommProofV1Protocol.mjs.map +1 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts +18 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.d.mts.map +1 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs +19 -0
- package/build/protocols/proofs/v1/errors/DidCommPresentationV1ProblemReportError.mjs.map +1 -0
- package/build/protocols/proofs/v1/errors/index.d.mts +1 -0
- package/build/protocols/proofs/v1/errors/index.mjs +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs +17 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1AckHandler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs +36 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs +16 -0
- package/build/protocols/proofs/v1/handlers/DidCommPresentationV1ProblemReportHandler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs +35 -0
- package/build/protocols/proofs/v1/handlers/DidCommProposePresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs +32 -0
- package/build/protocols/proofs/v1/handlers/DidCommRequestPresentationV1Handler.mjs.map +1 -0
- package/build/protocols/proofs/v1/handlers/index.mjs +5 -0
- package/build/protocols/proofs/v1/index.d.mts +11 -0
- package/build/protocols/proofs/v1/index.mjs +11 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts +12 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs +18 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1AckMessage.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts +38 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs +52 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts +16 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs +21 -0
- package/build/protocols/proofs/v1/messages/DidCommPresentationV1ProblemReportMessage.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts +32 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs +44 -0
- package/build/protocols/proofs/v1/messages/DidCommProposePresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts +36 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.d.mts.map +1 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs +50 -0
- package/build/protocols/proofs/v1/messages/DidCommRequestPresentationV1Message.mjs.map +1 -0
- package/build/protocols/proofs/v1/messages/index.d.mts +5 -0
- package/build/protocols/proofs/v1/messages/index.mjs +5 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts +57 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.d.mts.map +1 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs +113 -0
- package/build/protocols/proofs/v1/models/DidCommPresentationV1Preview.mjs.map +1 -0
- package/build/protocols/proofs/v1/models/index.d.mts +1 -0
- package/build/protocols/proofs/v1/models/index.mjs +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts +25 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs +26 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts +12 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs +28 -0
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts +44 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.mjs +38 -0
- package/build/repository/AnonCredsCredentialDefinitionRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts +12 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.mjs +28 -0
- package/build/repository/AnonCredsCredentialDefinitionRepository.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialRecord.d.mts +53 -0
- package/build/repository/AnonCredsCredentialRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialRecord.mjs +46 -0
- package/build/repository/AnonCredsCredentialRecord.mjs.map +1 -0
- package/build/repository/AnonCredsCredentialRepository.d.mts +14 -0
- package/build/repository/AnonCredsCredentialRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsCredentialRepository.mjs +34 -0
- package/build/repository/AnonCredsCredentialRepository.mjs.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts +25 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs +26 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.mjs.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts +12 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs +28 -0
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.mjs.map +1 -0
- package/build/repository/AnonCredsLinkSecretRecord.d.mts +28 -0
- package/build/repository/AnonCredsLinkSecretRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsLinkSecretRecord.mjs +25 -0
- package/build/repository/AnonCredsLinkSecretRecord.mjs.map +1 -0
- package/build/repository/AnonCredsLinkSecretRepository.d.mts +14 -0
- package/build/repository/AnonCredsLinkSecretRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsLinkSecretRepository.mjs +34 -0
- package/build/repository/AnonCredsLinkSecretRepository.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts +37 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs +35 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts +13 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs +34 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts +30 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs +27 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.mjs.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts +13 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs +31 -0
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.mjs.map +1 -0
- package/build/repository/AnonCredsSchemaRecord.d.mts +44 -0
- package/build/repository/AnonCredsSchemaRecord.d.mts.map +1 -0
- package/build/repository/AnonCredsSchemaRecord.mjs +38 -0
- package/build/repository/AnonCredsSchemaRecord.mjs.map +1 -0
- package/build/repository/AnonCredsSchemaRepository.d.mts +12 -0
- package/build/repository/AnonCredsSchemaRepository.d.mts.map +1 -0
- package/build/repository/AnonCredsSchemaRepository.mjs +28 -0
- package/build/repository/AnonCredsSchemaRepository.mjs.map +1 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs +10 -0
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.mjs.map +1 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs +10 -0
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.mjs.map +1 -0
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts +14 -0
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.mts.map +1 -0
- package/build/repository/index.d.mts +16 -0
- package/build/repository/index.mjs +16 -0
- package/build/services/AnonCredsHolderService.d.mts +28 -0
- package/build/services/AnonCredsHolderService.d.mts.map +1 -0
- package/build/services/AnonCredsHolderService.mjs +6 -0
- package/build/services/AnonCredsHolderService.mjs.map +1 -0
- package/build/services/AnonCredsHolderServiceOptions.d.mts +107 -0
- package/build/services/AnonCredsHolderServiceOptions.d.mts.map +1 -0
- package/build/services/AnonCredsIssuerService.d.mts +19 -0
- package/build/services/AnonCredsIssuerService.d.mts.map +1 -0
- package/build/services/AnonCredsIssuerService.mjs +6 -0
- package/build/services/AnonCredsIssuerService.mjs.map +1 -0
- package/build/services/AnonCredsIssuerServiceOptions.d.mts +66 -0
- package/build/services/AnonCredsIssuerServiceOptions.d.mts.map +1 -0
- package/build/services/AnonCredsVerifierService.d.mts +12 -0
- package/build/services/AnonCredsVerifierService.d.mts.map +1 -0
- package/build/services/AnonCredsVerifierService.mjs +6 -0
- package/build/services/AnonCredsVerifierService.mjs.map +1 -0
- package/build/services/AnonCredsVerifierServiceOptions.d.mts +30 -0
- package/build/services/AnonCredsVerifierServiceOptions.d.mts.map +1 -0
- package/build/services/index.d.mts +17 -0
- package/build/services/index.mjs +7 -0
- package/build/services/registry/AnonCredsRegistry.d.mts +43 -0
- package/build/services/registry/AnonCredsRegistry.d.mts.map +1 -0
- package/build/services/registry/AnonCredsRegistryService.d.mts +27 -0
- package/build/services/registry/AnonCredsRegistryService.d.mts.map +1 -0
- package/build/services/registry/AnonCredsRegistryService.mjs +226 -0
- package/build/services/registry/AnonCredsRegistryService.mjs.map +1 -0
- package/build/services/registry/CredentialDefinitionOptions.d.mts +39 -0
- package/build/services/registry/CredentialDefinitionOptions.d.mts.map +1 -0
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts +39 -0
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.mts.map +1 -0
- package/build/services/registry/RevocationStatusListOptions.d.mts +37 -0
- package/build/services/registry/RevocationStatusListOptions.d.mts.map +1 -0
- package/build/services/registry/SchemaOptions.d.mts +39 -0
- package/build/services/registry/SchemaOptions.d.mts.map +1 -0
- package/build/services/registry/base.d.mts +65 -0
- package/build/services/registry/base.d.mts.map +1 -0
- package/build/services/registry/index.d.mts +7 -0
- package/build/services/registry/index.mjs +1 -0
- package/build/services/tails/BasicTailsFileService.d.mts +29 -0
- package/build/services/tails/BasicTailsFileService.d.mts.map +1 -0
- package/build/services/tails/BasicTailsFileService.mjs +52 -0
- package/build/services/tails/BasicTailsFileService.mjs.map +1 -0
- package/build/services/tails/TailsFileService.d.mts +48 -0
- package/build/services/tails/TailsFileService.d.mts.map +1 -0
- package/build/services/tails/index.d.mts +2 -0
- package/build/services/tails/index.mjs +1 -0
- package/build/updates/0.3.1-0.4/credentialDefinition.mjs +49 -0
- package/build/updates/0.3.1-0.4/credentialDefinition.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs +118 -0
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/index.d.mts +7 -0
- package/build/updates/0.3.1-0.4/index.d.mts.map +1 -0
- package/build/updates/0.3.1-0.4/index.mjs +16 -0
- package/build/updates/0.3.1-0.4/index.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/linkSecret.mjs +21 -0
- package/build/updates/0.3.1-0.4/linkSecret.mjs.map +1 -0
- package/build/updates/0.3.1-0.4/schema.mjs +39 -0
- package/build/updates/0.3.1-0.4/schema.mjs.map +1 -0
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs +126 -0
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.mjs.map +1 -0
- package/build/updates/0.4-0.5/index.d.mts +7 -0
- package/build/updates/0.4-0.5/index.d.mts.map +1 -0
- package/build/updates/0.4-0.5/index.mjs +10 -0
- package/build/updates/0.4-0.5/index.mjs.map +1 -0
- package/build/utils/anonCredsObjects.d.mts +27 -0
- package/build/utils/anonCredsObjects.d.mts.map +1 -0
- package/build/utils/anonCredsObjects.mjs +57 -0
- package/build/utils/anonCredsObjects.mjs.map +1 -0
- package/build/utils/areRequestsEqual.d.mts +1 -0
- package/build/utils/areRequestsEqual.mjs +86 -0
- package/build/utils/areRequestsEqual.mjs.map +1 -0
- package/build/utils/bytesToBigint.mjs +11 -0
- package/build/utils/bytesToBigint.mjs.map +1 -0
- package/build/utils/composeAutoAccept.d.mts +1 -0
- package/build/utils/composeAutoAccept.mjs +25 -0
- package/build/utils/composeAutoAccept.mjs.map +1 -0
- package/build/utils/createRequestFromPreview.d.mts +2 -0
- package/build/utils/createRequestFromPreview.mjs +50 -0
- package/build/utils/createRequestFromPreview.mjs.map +1 -0
- package/build/utils/credential.d.mts +12 -0
- package/build/utils/credential.d.mts.map +1 -0
- package/build/utils/credential.mjs +119 -0
- package/build/utils/credential.mjs.map +1 -0
- package/build/utils/credentialPreviewAttributes.d.mts +1 -0
- package/build/utils/credentialPreviewAttributes.mjs +21 -0
- package/build/utils/credentialPreviewAttributes.mjs.map +1 -0
- package/build/utils/getCredentialsForAnonCredsRequest.d.mts +11 -0
- package/build/utils/getCredentialsForAnonCredsRequest.d.mts.map +1 -0
- package/build/utils/getCredentialsForAnonCredsRequest.mjs +70 -0
- package/build/utils/getCredentialsForAnonCredsRequest.mjs.map +1 -0
- package/build/utils/getRevocationRegistries.d.mts +4 -0
- package/build/utils/getRevocationRegistries.mjs +121 -0
- package/build/utils/getRevocationRegistries.mjs.map +1 -0
- package/build/utils/hasDuplicateGroupNames.d.mts +1 -0
- package/build/utils/hasDuplicateGroupNames.mjs +22 -0
- package/build/utils/hasDuplicateGroupNames.mjs.map +1 -0
- package/build/utils/index.d.mts +17 -0
- package/build/utils/index.mjs +17 -0
- package/build/utils/indyIdentifiers.d.mts +71 -0
- package/build/utils/indyIdentifiers.d.mts.map +1 -0
- package/build/utils/indyIdentifiers.mjs +249 -0
- package/build/utils/indyIdentifiers.mjs.map +1 -0
- package/build/utils/isMap.d.mts +1 -0
- package/build/utils/isMap.mjs +19 -0
- package/build/utils/isMap.mjs.map +1 -0
- package/build/utils/linkSecret.d.mts +13 -0
- package/build/utils/linkSecret.d.mts.map +1 -0
- package/build/utils/linkSecret.mjs +35 -0
- package/build/utils/linkSecret.mjs.map +1 -0
- package/build/utils/metadata.d.mts +30 -0
- package/build/utils/metadata.d.mts.map +1 -0
- package/build/utils/metadata.mjs +23 -0
- package/build/utils/metadata.mjs.map +1 -0
- package/build/utils/proofRequest.mjs +10 -0
- package/build/utils/proofRequest.mjs.map +1 -0
- package/build/utils/proverDid.d.mts +12 -0
- package/build/utils/proverDid.d.mts.map +1 -0
- package/build/utils/proverDid.mjs +17 -0
- package/build/utils/proverDid.mjs.map +1 -0
- package/build/utils/revocationInterval.d.mts +12 -0
- package/build/utils/revocationInterval.d.mts.map +1 -0
- package/build/utils/revocationInterval.mjs +11 -0
- package/build/utils/revocationInterval.mjs.map +1 -0
- package/build/utils/sortRequestedCredentialsMatches.d.mts +1 -0
- package/build/utils/sortRequestedCredentialsMatches.mjs +22 -0
- package/build/utils/sortRequestedCredentialsMatches.mjs.map +1 -0
- package/build/utils/timestamp.d.mts +5 -0
- package/build/utils/timestamp.d.mts.map +1 -0
- package/build/utils/timestamp.mjs +6 -0
- package/build/utils/timestamp.mjs.map +1 -0
- package/build/utils/w3cAnonCredsUtils.d.mts +28 -0
- package/build/utils/w3cAnonCredsUtils.d.mts.map +1 -0
- package/build/utils/w3cAnonCredsUtils.mjs +101 -0
- package/build/utils/w3cAnonCredsUtils.mjs.map +1 -0
- package/package.json +20 -21
- package/build/AnonCredsApi.d.ts +0 -97
- package/build/AnonCredsApi.js +0 -582
- package/build/AnonCredsApi.js.map +0 -1
- package/build/AnonCredsApiOptions.d.ts +0 -24
- package/build/AnonCredsApiOptions.js +0 -3
- package/build/AnonCredsApiOptions.js.map +0 -1
- package/build/AnonCredsModule.d.ts +0 -24
- package/build/AnonCredsModule.js +0 -56
- package/build/AnonCredsModule.js.map +0 -1
- package/build/AnonCredsModuleConfig.d.ts +0 -72
- package/build/AnonCredsModuleConfig.js +0 -31
- package/build/AnonCredsModuleConfig.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.d.ts +0 -27
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.js +0 -241
- package/build/anoncreds-rs/AnonCredsDataIntegrityService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsHolderService.d.ts +0 -38
- package/build/anoncreds-rs/AnonCredsRsHolderService.js +0 -622
- package/build/anoncreds-rs/AnonCredsRsHolderService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsIssuerService.d.ts +0 -12
- package/build/anoncreds-rs/AnonCredsRsIssuerService.js +0 -253
- package/build/anoncreds-rs/AnonCredsRsIssuerService.js.map +0 -1
- package/build/anoncreds-rs/AnonCredsRsVerifierService.d.ts +0 -8
- package/build/anoncreds-rs/AnonCredsRsVerifierService.js +0 -157
- package/build/anoncreds-rs/AnonCredsRsVerifierService.js.map +0 -1
- package/build/anoncreds-rs/index.d.ts +0 -3
- package/build/anoncreds-rs/index.js +0 -10
- package/build/anoncreds-rs/index.js.map +0 -1
- package/build/anoncreds-rs/utils.d.ts +0 -23
- package/build/anoncreds-rs/utils.js +0 -71
- package/build/anoncreds-rs/utils.js.map +0 -1
- package/build/error/AnonCredsError.d.ts +0 -6
- package/build/error/AnonCredsError.js +0 -11
- package/build/error/AnonCredsError.js.map +0 -1
- package/build/error/AnonCredsRsError.d.ts +0 -6
- package/build/error/AnonCredsRsError.js +0 -11
- package/build/error/AnonCredsRsError.js.map +0 -1
- package/build/error/AnonCredsStoreRecordError.d.ts +0 -6
- package/build/error/AnonCredsStoreRecordError.js +0 -11
- package/build/error/AnonCredsStoreRecordError.js.map +0 -1
- package/build/error/index.d.ts +0 -3
- package/build/error/index.js +0 -20
- package/build/error/index.js.map +0 -1
- package/build/formats/AnonCredsCredentialFormat.d.ts +0 -79
- package/build/formats/AnonCredsCredentialFormat.js +0 -3
- package/build/formats/AnonCredsCredentialFormat.js.map +0 -1
- package/build/formats/AnonCredsCredentialFormatService.d.ts +0 -80
- package/build/formats/AnonCredsCredentialFormatService.js +0 -433
- package/build/formats/AnonCredsCredentialFormatService.js.map +0 -1
- package/build/formats/AnonCredsProofFormat.d.ts +0 -70
- package/build/formats/AnonCredsProofFormat.js +0 -3
- package/build/formats/AnonCredsProofFormat.js.map +0 -1
- package/build/formats/AnonCredsProofFormatService.d.ts +0 -55
- package/build/formats/AnonCredsProofFormatService.js +0 -289
- package/build/formats/AnonCredsProofFormatService.js.map +0 -1
- package/build/formats/DataIntegrityCredentialFormatService.d.ts +0 -89
- package/build/formats/DataIntegrityCredentialFormatService.js +0 -773
- package/build/formats/DataIntegrityCredentialFormatService.js.map +0 -1
- package/build/formats/LegacyIndyCredentialFormat.d.ts +0 -32
- package/build/formats/LegacyIndyCredentialFormat.js +0 -3
- package/build/formats/LegacyIndyCredentialFormat.js.map +0 -1
- package/build/formats/LegacyIndyCredentialFormatService.d.ts +0 -80
- package/build/formats/LegacyIndyCredentialFormatService.js +0 -379
- package/build/formats/LegacyIndyCredentialFormatService.js.map +0 -1
- package/build/formats/LegacyIndyProofFormat.d.ts +0 -29
- package/build/formats/LegacyIndyProofFormat.js +0 -3
- package/build/formats/LegacyIndyProofFormat.js.map +0 -1
- package/build/formats/LegacyIndyProofFormatService.d.ts +0 -58
- package/build/formats/LegacyIndyProofFormatService.js +0 -374
- package/build/formats/LegacyIndyProofFormatService.js.map +0 -1
- package/build/formats/index.d.ts +0 -9
- package/build/formats/index.js +0 -32
- package/build/formats/index.js.map +0 -1
- package/build/index.d.ts +0 -21
- package/build/index.js +0 -54
- package/build/index.js.map +0 -1
- package/build/models/AnonCredsCredentialProposal.d.ts +0 -62
- package/build/models/AnonCredsCredentialProposal.js +0 -81
- package/build/models/AnonCredsCredentialProposal.js.map +0 -1
- package/build/models/AnonCredsProofRequest.d.ts +0 -27
- package/build/models/AnonCredsProofRequest.js +0 -82
- package/build/models/AnonCredsProofRequest.js.map +0 -1
- package/build/models/AnonCredsRequestedAttribute.d.ts +0 -16
- package/build/models/AnonCredsRequestedAttribute.js +0 -56
- package/build/models/AnonCredsRequestedAttribute.js.map +0 -1
- package/build/models/AnonCredsRequestedPredicate.d.ts +0 -19
- package/build/models/AnonCredsRequestedPredicate.js +0 -61
- package/build/models/AnonCredsRequestedPredicate.js.map +0 -1
- package/build/models/AnonCredsRestriction.d.ts +0 -55
- package/build/models/AnonCredsRestriction.js +0 -160
- package/build/models/AnonCredsRestriction.js.map +0 -1
- package/build/models/AnonCredsRestrictionWrapper.d.ts +0 -4
- package/build/models/AnonCredsRestrictionWrapper.js +0 -25
- package/build/models/AnonCredsRestrictionWrapper.js.map +0 -1
- package/build/models/AnonCredsRevocationInterval.d.ts +0 -5
- package/build/models/AnonCredsRevocationInterval.js +0 -33
- package/build/models/AnonCredsRevocationInterval.js.map +0 -1
- package/build/models/exchange.d.ts +0 -99
- package/build/models/exchange.js +0 -5
- package/build/models/exchange.js.map +0 -1
- package/build/models/index.d.ts +0 -4
- package/build/models/index.js +0 -21
- package/build/models/index.js.map +0 -1
- package/build/models/internal.d.ts +0 -35
- package/build/models/internal.js +0 -3
- package/build/models/internal.js.map +0 -1
- package/build/models/registry.d.ts +0 -39
- package/build/models/registry.js +0 -3
- package/build/models/registry.js.map +0 -1
- package/build/models/utils.d.ts +0 -22
- package/build/models/utils.js +0 -3
- package/build/models/utils.js.map +0 -1
- package/build/protocols/credentials/v1/V1CredentialProtocol.d.ts +0 -162
- package/build/protocols/credentials/v1/V1CredentialProtocol.js +0 -948
- package/build/protocols/credentials/v1/V1CredentialProtocol.js.map +0 -1
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.d.ts +0 -10
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js +0 -18
- package/build/protocols/credentials/v1/errors/V1CredentialProblemReportError.js.map +0 -1
- package/build/protocols/credentials/v1/errors/index.d.ts +0 -1
- package/build/protocols/credentials/v1/errors/index.js +0 -6
- package/build/protocols/credentials/v1/errors/index.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.d.ts +0 -9
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js +0 -15
- package/build/protocols/credentials/v1/handlers/V1CredentialAckHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.d.ts +0 -9
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js +0 -15
- package/build/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js +0 -40
- package/build/protocols/credentials/v1/handlers/V1IssueCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js +0 -33
- package/build/protocols/credentials/v1/handlers/V1OfferCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js +0 -38
- package/build/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.d.ts +0 -10
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js +0 -40
- package/build/protocols/credentials/v1/handlers/V1RequestCredentialHandler.js.map +0 -1
- package/build/protocols/credentials/v1/handlers/index.d.ts +0 -6
- package/build/protocols/credentials/v1/handlers/index.js +0 -23
- package/build/protocols/credentials/v1/handlers/index.js.map +0 -1
- package/build/protocols/credentials/v1/index.d.ts +0 -2
- package/build/protocols/credentials/v1/index.js +0 -19
- package/build/protocols/credentials/v1/index.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.d.ts +0 -16
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js +0 -34
- package/build/protocols/credentials/v1/messages/V1CredentialAckMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.d.ts +0 -26
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.js +0 -69
- package/build/protocols/credentials/v1/messages/V1CredentialPreview.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.d.ts +0 -16
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js +0 -34
- package/build/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.d.ts +0 -19
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js +0 -62
- package/build/protocols/credentials/v1/messages/V1IssueCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.d.ts +0 -27
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js +0 -75
- package/build/protocols/credentials/v1/messages/V1OfferCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.d.ts +0 -59
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js +0 -109
- package/build/protocols/credentials/v1/messages/V1ProposeCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.d.ts +0 -19
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js +0 -61
- package/build/protocols/credentials/v1/messages/V1RequestCredentialMessage.js.map +0 -1
- package/build/protocols/credentials/v1/messages/index.d.ts +0 -7
- package/build/protocols/credentials/v1/messages/index.js +0 -24
- package/build/protocols/credentials/v1/messages/index.js.map +0 -1
- package/build/protocols/index.d.ts +0 -2
- package/build/protocols/index.js +0 -19
- package/build/protocols/index.js.map +0 -1
- package/build/protocols/proofs/v1/V1ProofProtocol.d.ts +0 -50
- package/build/protocols/proofs/v1/V1ProofProtocol.js +0 -864
- package/build/protocols/proofs/v1/V1ProofProtocol.js.map +0 -1
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.d.ts +0 -12
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js +0 -19
- package/build/protocols/proofs/v1/errors/V1PresentationProblemReportError.js.map +0 -1
- package/build/protocols/proofs/v1/errors/index.d.ts +0 -1
- package/build/protocols/proofs/v1/errors/index.js +0 -18
- package/build/protocols/proofs/v1/errors/index.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.d.ts +0 -9
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js +0 -15
- package/build/protocols/proofs/v1/handlers/V1PresentationAckHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.d.ts +0 -10
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js +0 -40
- package/build/protocols/proofs/v1/handlers/V1PresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.d.ts +0 -9
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js +0 -15
- package/build/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.d.ts +0 -11
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js +0 -38
- package/build/protocols/proofs/v1/handlers/V1ProposePresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.d.ts +0 -10
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js +0 -35
- package/build/protocols/proofs/v1/handlers/V1RequestPresentationHandler.js.map +0 -1
- package/build/protocols/proofs/v1/handlers/index.d.ts +0 -5
- package/build/protocols/proofs/v1/handlers/index.js +0 -22
- package/build/protocols/proofs/v1/handlers/index.js.map +0 -1
- package/build/protocols/proofs/v1/index.d.ts +0 -4
- package/build/protocols/proofs/v1/index.js +0 -21
- package/build/protocols/proofs/v1/index.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.d.ts +0 -8
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js +0 -27
- package/build/protocols/proofs/v1/messages/V1PresentationAckMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.d.ts +0 -31
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.js +0 -67
- package/build/protocols/proofs/v1/messages/V1PresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.d.ts +0 -16
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js +0 -34
- package/build/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.d.ts +0 -26
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js +0 -53
- package/build/protocols/proofs/v1/messages/V1ProposePresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.d.ts +0 -29
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js +0 -65
- package/build/protocols/proofs/v1/messages/V1RequestPresentationMessage.js.map +0 -1
- package/build/protocols/proofs/v1/messages/index.d.ts +0 -5
- package/build/protocols/proofs/v1/messages/index.js +0 -22
- package/build/protocols/proofs/v1/messages/index.js.map +0 -1
- package/build/protocols/proofs/v1/models/V1PresentationPreview.d.ts +0 -50
- package/build/protocols/proofs/v1/models/V1PresentationPreview.js +0 -130
- package/build/protocols/proofs/v1/models/V1PresentationPreview.js.map +0 -1
- package/build/protocols/proofs/v1/models/index.d.ts +0 -1
- package/build/protocols/proofs/v1/models/index.js +0 -18
- package/build/protocols/proofs/v1/models/index.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.d.ts +0 -21
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js +0 -23
- package/build/repository/AnonCredsCredentialDefinitionPrivateRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.d.ts +0 -8
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js +0 -35
- package/build/repository/AnonCredsCredentialDefinitionPrivateRepository.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionRecord.d.ts +0 -39
- package/build/repository/AnonCredsCredentialDefinitionRecord.js +0 -30
- package/build/repository/AnonCredsCredentialDefinitionRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialDefinitionRepository.d.ts +0 -8
- package/build/repository/AnonCredsCredentialDefinitionRepository.js +0 -53
- package/build/repository/AnonCredsCredentialDefinitionRepository.js.map +0 -1
- package/build/repository/AnonCredsCredentialRecord.d.ts +0 -48
- package/build/repository/AnonCredsCredentialRecord.js +0 -37
- package/build/repository/AnonCredsCredentialRecord.js.map +0 -1
- package/build/repository/AnonCredsCredentialRepository.d.ts +0 -10
- package/build/repository/AnonCredsCredentialRepository.js +0 -41
- package/build/repository/AnonCredsCredentialRepository.js.map +0 -1
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.d.ts +0 -21
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.js +0 -23
- package/build/repository/AnonCredsKeyCorrectnessProofRecord.js.map +0 -1
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.d.ts +0 -8
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.js +0 -35
- package/build/repository/AnonCredsKeyCorrectnessProofRepository.js.map +0 -1
- package/build/repository/AnonCredsLinkSecretRecord.d.ts +0 -23
- package/build/repository/AnonCredsLinkSecretRecord.js +0 -22
- package/build/repository/AnonCredsLinkSecretRecord.js.map +0 -1
- package/build/repository/AnonCredsLinkSecretRepository.d.ts +0 -10
- package/build/repository/AnonCredsLinkSecretRepository.js +0 -41
- package/build/repository/AnonCredsLinkSecretRepository.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.d.ts +0 -34
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js +0 -30
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.d.ts +0 -10
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js +0 -38
- package/build/repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.d.ts +0 -25
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js +0 -23
- package/build/repository/AnonCredsRevocationRegistryDefinitionRecord.js.map +0 -1
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.d.ts +0 -9
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js +0 -38
- package/build/repository/AnonCredsRevocationRegistryDefinitionRepository.js.map +0 -1
- package/build/repository/AnonCredsSchemaRecord.d.ts +0 -39
- package/build/repository/AnonCredsSchemaRecord.js +0 -30
- package/build/repository/AnonCredsSchemaRecord.js.map +0 -1
- package/build/repository/AnonCredsSchemaRepository.d.ts +0 -8
- package/build/repository/AnonCredsSchemaRepository.js +0 -53
- package/build/repository/AnonCredsSchemaRepository.js.map +0 -1
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsCredentialDefinitionRecordMetadataTypes.js.map +0 -1
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsRevocationRegistryDefinitionRecordMetadataTypes.js.map +0 -1
- package/build/repository/anonCredsSchemaRecordMetadataTypes.d.ts +0 -9
- package/build/repository/anonCredsSchemaRecordMetadataTypes.js +0 -9
- package/build/repository/anonCredsSchemaRecordMetadataTypes.js.map +0 -1
- package/build/repository/index.d.ts +0 -16
- package/build/repository/index.js +0 -33
- package/build/repository/index.js.map +0 -1
- package/build/services/AnonCredsHolderService.d.ts +0 -18
- package/build/services/AnonCredsHolderService.js +0 -5
- package/build/services/AnonCredsHolderService.js.map +0 -1
- package/build/services/AnonCredsHolderServiceOptions.d.ts +0 -101
- package/build/services/AnonCredsHolderServiceOptions.js +0 -3
- package/build/services/AnonCredsHolderServiceOptions.js.map +0 -1
- package/build/services/AnonCredsIssuerService.d.ts +0 -14
- package/build/services/AnonCredsIssuerService.js +0 -5
- package/build/services/AnonCredsIssuerService.js.map +0 -1
- package/build/services/AnonCredsIssuerServiceOptions.d.ts +0 -61
- package/build/services/AnonCredsIssuerServiceOptions.js +0 -3
- package/build/services/AnonCredsIssuerServiceOptions.js.map +0 -1
- package/build/services/AnonCredsVerifierService.d.ts +0 -7
- package/build/services/AnonCredsVerifierService.js +0 -5
- package/build/services/AnonCredsVerifierService.js.map +0 -1
- package/build/services/AnonCredsVerifierServiceOptions.d.ts +0 -25
- package/build/services/AnonCredsVerifierServiceOptions.js +0 -3
- package/build/services/AnonCredsVerifierServiceOptions.js.map +0 -1
- package/build/services/index.d.ts +0 -8
- package/build/services/index.js +0 -27
- package/build/services/index.js.map +0 -1
- package/build/services/registry/AnonCredsRegistry.d.ts +0 -25
- package/build/services/registry/AnonCredsRegistry.js +0 -3
- package/build/services/registry/AnonCredsRegistry.js.map +0 -1
- package/build/services/registry/AnonCredsRegistryService.d.ts +0 -10
- package/build/services/registry/AnonCredsRegistryService.js +0 -33
- package/build/services/registry/AnonCredsRegistryService.js.map +0 -1
- package/build/services/registry/CredentialDefinitionOptions.d.ts +0 -34
- package/build/services/registry/CredentialDefinitionOptions.js +0 -3
- package/build/services/registry/CredentialDefinitionOptions.js.map +0 -1
- package/build/services/registry/RevocationRegistryDefinitionOptions.d.ts +0 -34
- package/build/services/registry/RevocationRegistryDefinitionOptions.js +0 -3
- package/build/services/registry/RevocationRegistryDefinitionOptions.js.map +0 -1
- package/build/services/registry/RevocationStatusListOptions.d.ts +0 -32
- package/build/services/registry/RevocationStatusListOptions.js +0 -3
- package/build/services/registry/RevocationStatusListOptions.js.map +0 -1
- package/build/services/registry/SchemaOptions.d.ts +0 -34
- package/build/services/registry/SchemaOptions.js +0 -3
- package/build/services/registry/SchemaOptions.js.map +0 -1
- package/build/services/registry/base.d.ts +0 -19
- package/build/services/registry/base.js +0 -3
- package/build/services/registry/base.js.map +0 -1
- package/build/services/registry/index.d.ts +0 -7
- package/build/services/registry/index.js +0 -23
- package/build/services/registry/index.js.map +0 -1
- package/build/services/tails/BasicTailsFileService.d.ts +0 -23
- package/build/services/tails/BasicTailsFileService.js +0 -65
- package/build/services/tails/BasicTailsFileService.js.map +0 -1
- package/build/services/tails/TailsFileService.d.ts +0 -42
- package/build/services/tails/TailsFileService.js +0 -3
- package/build/services/tails/TailsFileService.js.map +0 -1
- package/build/services/tails/index.d.ts +0 -2
- package/build/services/tails/index.js +0 -19
- package/build/services/tails/index.js.map +0 -1
- package/build/updates/0.3.1-0.4/credentialDefinition.d.ts +0 -18
- package/build/updates/0.3.1-0.4/credentialDefinition.js +0 -56
- package/build/updates/0.3.1-0.4/credentialDefinition.js.map +0 -1
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.d.ts +0 -69
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.js +0 -121
- package/build/updates/0.3.1-0.4/credentialExchangeRecord.js.map +0 -1
- package/build/updates/0.3.1-0.4/index.d.ts +0 -2
- package/build/updates/0.3.1-0.4/index.js +0 -14
- package/build/updates/0.3.1-0.4/index.js.map +0 -1
- package/build/updates/0.3.1-0.4/linkSecret.d.ts +0 -6
- package/build/updates/0.3.1-0.4/linkSecret.js +0 -35
- package/build/updates/0.3.1-0.4/linkSecret.js.map +0 -1
- package/build/updates/0.3.1-0.4/schema.d.ts +0 -15
- package/build/updates/0.3.1-0.4/schema.js +0 -41
- package/build/updates/0.3.1-0.4/schema.js.map +0 -1
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.d.ts +0 -5
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.js +0 -149
- package/build/updates/0.4-0.5/anonCredsCredentialRecord.js.map +0 -1
- package/build/updates/0.4-0.5/index.d.ts +0 -2
- package/build/updates/0.4-0.5/index.js +0 -8
- package/build/updates/0.4-0.5/index.js.map +0 -1
- package/build/utils/anonCredsObjects.d.ts +0 -26
- package/build/utils/anonCredsObjects.js +0 -81
- package/build/utils/anonCredsObjects.js.map +0 -1
- package/build/utils/areRequestsEqual.d.ts +0 -6
- package/build/utils/areRequestsEqual.js +0 -135
- package/build/utils/areRequestsEqual.js.map +0 -1
- package/build/utils/composeAutoAccept.d.ts +0 -15
- package/build/utils/composeAutoAccept.js +0 -26
- package/build/utils/composeAutoAccept.js.map +0 -1
- package/build/utils/createRequestFromPreview.d.ts +0 -10
- package/build/utils/createRequestFromPreview.js +0 -71
- package/build/utils/createRequestFromPreview.js.map +0 -1
- package/build/utils/credential.d.ts +0 -68
- package/build/utils/credential.js +0 -188
- package/build/utils/credential.js.map +0 -1
- package/build/utils/credentialPreviewAttributes.d.ts +0 -2
- package/build/utils/credentialPreviewAttributes.js +0 -24
- package/build/utils/credentialPreviewAttributes.js.map +0 -1
- package/build/utils/getCredentialsForAnonCredsRequest.d.ts +0 -4
- package/build/utils/getCredentialsForAnonCredsRequest.js +0 -81
- package/build/utils/getCredentialsForAnonCredsRequest.js.map +0 -1
- package/build/utils/getRevocationRegistries.d.ts +0 -14
- package/build/utils/getRevocationRegistries.js +0 -151
- package/build/utils/getRevocationRegistries.js.map +0 -1
- package/build/utils/hasDuplicateGroupNames.d.ts +0 -2
- package/build/utils/hasDuplicateGroupNames.js +0 -22
- package/build/utils/hasDuplicateGroupNames.js.map +0 -1
- package/build/utils/index.d.ts +0 -17
- package/build/utils/index.js +0 -48
- package/build/utils/index.js.map +0 -1
- package/build/utils/indyIdentifiers.d.ts +0 -66
- package/build/utils/indyIdentifiers.js +0 -298
- package/build/utils/indyIdentifiers.js.map +0 -1
- package/build/utils/isMap.d.ts +0 -5
- package/build/utils/isMap.js +0 -17
- package/build/utils/isMap.js.map +0 -1
- package/build/utils/linkSecret.d.ts +0 -9
- package/build/utils/linkSecret.js +0 -43
- package/build/utils/linkSecret.js.map +0 -1
- package/build/utils/metadata.d.ts +0 -35
- package/build/utils/metadata.js +0 -24
- package/build/utils/metadata.js.map +0 -1
- package/build/utils/proofRequest.d.ts +0 -2
- package/build/utils/proofRequest.js +0 -21
- package/build/utils/proofRequest.js.map +0 -1
- package/build/utils/proverDid.d.ts +0 -8
- package/build/utils/proverDid.js +0 -15
- package/build/utils/proverDid.js.map +0 -1
- package/build/utils/revocationInterval.d.ts +0 -7
- package/build/utils/revocationInterval.js +0 -14
- package/build/utils/revocationInterval.js.map +0 -1
- package/build/utils/sortRequestedCredentialsMatches.d.ts +0 -8
- package/build/utils/sortRequestedCredentialsMatches.js +0 -31
- package/build/utils/sortRequestedCredentialsMatches.js.map +0 -1
- package/build/utils/timestamp.d.ts +0 -1
- package/build/utils/timestamp.js +0 -7
- package/build/utils/timestamp.js.map +0 -1
- package/build/utils/w3cAnonCredsUtils.d.ts +0 -37
- package/build/utils/w3cAnonCredsUtils.js +0 -132
- package/build/utils/w3cAnonCredsUtils.js.map +0 -1
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
import { AnonCredsCredentialDefinitionRepository } from "../repository/AnonCredsCredentialDefinitionRepository.mjs";
|
|
2
|
+
import { AnonCredsRevocationRegistryState } from "../repository/AnonCredsRevocationRegistryDefinitionPrivateRecord.mjs";
|
|
3
|
+
import { AnonCredsRevocationRegistryDefinitionPrivateRepository } from "../repository/AnonCredsRevocationRegistryDefinitionPrivateRepository.mjs";
|
|
4
|
+
import "../repository/index.mjs";
|
|
5
|
+
import { AnonCredsHolderServiceSymbol } from "../services/AnonCredsHolderService.mjs";
|
|
6
|
+
import { AnonCredsIssuerServiceSymbol } from "../services/AnonCredsIssuerService.mjs";
|
|
7
|
+
import "../services/index.mjs";
|
|
8
|
+
import { fetchCredentialDefinition, fetchRevocationRegistryDefinition, fetchRevocationStatusList, fetchSchema } from "../utils/anonCredsObjects.mjs";
|
|
9
|
+
import { assertAttributesMatch, convertAttributesToCredentialValues } from "../utils/credential.mjs";
|
|
10
|
+
import { dateToTimestamp } from "../utils/timestamp.mjs";
|
|
11
|
+
import { AnonCredsCredentialMetadataKey, AnonCredsCredentialRequestMetadataKey } from "../utils/metadata.mjs";
|
|
12
|
+
import { getAnonCredsTagsFromRecord } from "../utils/w3cAnonCredsUtils.mjs";
|
|
13
|
+
import "../utils/index.mjs";
|
|
14
|
+
import { ClaimFormat, CredoError, DidsApi, JsonEncoder, JsonTransformer, JwsService, JwtPayload, Kms, SignatureSuiteRegistry, TypedArrayEncoder, W3cCredential, W3cCredentialRecord, W3cCredentialService, W3cCredentialSubject, W3cJsonLdVerifiableCredential, deepEquality, getPublicJwkFromVerificationMethod, parseDid } from "@credo-ts/core";
|
|
15
|
+
import { DataIntegrityCredentialOffer, DidCommAttachment, DidCommAttachmentData, DidCommCredentialFormatSpec, DidCommCredentialPreviewAttribute, DidCommCredentialProblemReportReason, DidCommProblemReportError } from "@credo-ts/didcomm";
|
|
16
|
+
|
|
17
|
+
//#region src/formats/DataIntegrityDidCommCredentialFormatService.ts
|
|
18
|
+
const W3C_DATA_INTEGRITY_CREDENTIAL_OFFER = "didcomm/w3c-di-vc-offer@v0.1";
|
|
19
|
+
const W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST = "didcomm/w3c-di-vc-request@v0.1";
|
|
20
|
+
const W3C_DATA_INTEGRITY_CREDENTIAL = "didcomm/w3c-di-vc@v0.1";
|
|
21
|
+
var DataIntegrityDidCommCredentialFormatService = class {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.formatKey = "dataIntegrity";
|
|
24
|
+
this.credentialRecordType = "w3c";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a {@link AttachmentFormats} object dependent on the message type.
|
|
28
|
+
*
|
|
29
|
+
* @param options The object containing all the options for the proposed credential
|
|
30
|
+
* @returns object containing associated attachment, format and optionally the credential preview
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
async createProposal(_agentContext, options) {
|
|
34
|
+
throw new CredoError("Not defined");
|
|
35
|
+
}
|
|
36
|
+
async processProposal(_agentContext, options) {
|
|
37
|
+
throw new CredoError("Not defined");
|
|
38
|
+
}
|
|
39
|
+
async acceptProposal(_agentContext, _input) {
|
|
40
|
+
throw new CredoError("Not defined");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create a credential attachment format for a credential request.
|
|
44
|
+
*
|
|
45
|
+
* @param options The object containing all the options for the credential offer
|
|
46
|
+
* @returns object containing associated attachment, formats and offersAttach elements
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
async createOffer(agentContext, { credentialFormats, credentialExchangeRecord, attachmentId }) {
|
|
50
|
+
const dataIntegrityFormat = credentialFormats.dataIntegrity;
|
|
51
|
+
if (!dataIntegrityFormat) throw new CredoError("Missing data integrity credential format data");
|
|
52
|
+
const format = new DidCommCredentialFormatSpec({
|
|
53
|
+
attachmentId,
|
|
54
|
+
format: W3C_DATA_INTEGRITY_CREDENTIAL_OFFER
|
|
55
|
+
});
|
|
56
|
+
if ("proof" in dataIntegrityFormat.credential) throw new CredoError("The offered credential MUST NOT contain any proofs.");
|
|
57
|
+
const { dataIntegrityCredentialOffer, previewAttributes } = await this.createDataIntegrityCredentialOffer(agentContext, credentialExchangeRecord, dataIntegrityFormat);
|
|
58
|
+
return {
|
|
59
|
+
format,
|
|
60
|
+
attachment: this.getFormatData(JsonTransformer.toJSON(dataIntegrityCredentialOffer), format.attachmentId),
|
|
61
|
+
previewAttributes
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
getCredentialVersion(credentialJson) {
|
|
65
|
+
const context = credentialJson["@context"];
|
|
66
|
+
if (!context || !Array.isArray(context)) throw new CredoError("Invalid @context in credential offer");
|
|
67
|
+
const isV1Credential = context.find((c) => c === "https://www.w3.org/2018/credentials/v1");
|
|
68
|
+
const isV2Credential = context.find((c) => c === "https://www.w3.org/ns/credentials/v2");
|
|
69
|
+
if (isV1Credential) return "1.1";
|
|
70
|
+
if (isV2Credential) throw new CredoError("Received w3c credential with unsupported version 2.0.");
|
|
71
|
+
throw new CredoError("Cannot determine credential version from @context");
|
|
72
|
+
}
|
|
73
|
+
async processOffer(agentContext, { attachment, credentialExchangeRecord }) {
|
|
74
|
+
agentContext.config.logger.debug(`Processing data integrity credential offer for credential record ${credentialExchangeRecord.id}`);
|
|
75
|
+
const dataIntegrityCredentialOffer = JsonTransformer.fromJSON(attachment.getDataAsJson(), DataIntegrityCredentialOffer);
|
|
76
|
+
const credentialJson = dataIntegrityCredentialOffer.credential;
|
|
77
|
+
const credentialVersion = this.getCredentialVersion(credentialJson);
|
|
78
|
+
const credentialToBeValidated = {
|
|
79
|
+
...credentialJson,
|
|
80
|
+
issuer: credentialJson.issuer ?? "https://example.com",
|
|
81
|
+
...credentialVersion === "1.1" ? { issuanceDate: (/* @__PURE__ */ new Date()).toISOString() } : { validFrom: (/* @__PURE__ */ new Date()).toISOString() }
|
|
82
|
+
};
|
|
83
|
+
JsonTransformer.fromJSON(credentialToBeValidated, W3cCredential);
|
|
84
|
+
if (dataIntegrityCredentialOffer.bindingRequired && !dataIntegrityCredentialOffer.bindingMethod?.anoncredsLinkSecret && !dataIntegrityCredentialOffer.bindingMethod?.didcommSignedAttachment) throw new DidCommProblemReportError("Invalid credential offer. Missing binding method.", { problemCode: DidCommCredentialProblemReportReason.IssuanceAbandoned });
|
|
85
|
+
}
|
|
86
|
+
async createSignedAttachment(agentContext, data, options, issuerSupportedAlgs) {
|
|
87
|
+
const { alg, kid } = options;
|
|
88
|
+
if (!kid.startsWith("did:")) throw new CredoError(`kid '${kid}' is not a DID. Only dids are supported for kid`);
|
|
89
|
+
if (!kid.includes("#")) throw new CredoError(`kid '${kid}' does not contain a fragment. kid MUST point to a specific key in the did document.`);
|
|
90
|
+
const parsedDid = parseDid(kid);
|
|
91
|
+
const { didDocument, keys } = await agentContext.dependencyManager.resolve(DidsApi).resolveCreatedDidDocumentWithKeys(parsedDid.did);
|
|
92
|
+
const publicJwk = getPublicJwkFromVerificationMethod(didDocument.dereferenceKey(kid));
|
|
93
|
+
const keyId = keys?.find(({ didDocumentRelativeKeyId }) => didDocumentRelativeKeyId === `#${parsedDid.fragment}`)?.kmsKeyId ?? publicJwk.legacyKeyId;
|
|
94
|
+
if (alg && !publicJwk.supportedSignatureAlgorithms.includes(alg)) throw new CredoError(`jwk ${publicJwk.jwkTypeHumanDescription}, does not support the JWS signature alg '${alg}'`);
|
|
95
|
+
const signingAlg = issuerSupportedAlgs.find((supportedAlg) => publicJwk.supportedSignatureAlgorithms.includes(supportedAlg) && (alg === void 0 || alg === supportedAlg));
|
|
96
|
+
if (!signingAlg) throw new CredoError("No signing algorithm supported by the issuer found");
|
|
97
|
+
const jws = await agentContext.dependencyManager.resolve(JwsService).createJws(agentContext, {
|
|
98
|
+
keyId,
|
|
99
|
+
header: {},
|
|
100
|
+
payload: new JwtPayload({ additionalClaims: { nonce: data.nonce } }),
|
|
101
|
+
protectedHeaderOptions: {
|
|
102
|
+
alg: signingAlg,
|
|
103
|
+
kid
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const signedAttach = new DidCommAttachment({
|
|
107
|
+
mimeType: "application/json",
|
|
108
|
+
data: new DidCommAttachmentData({ base64: jws.payload })
|
|
109
|
+
});
|
|
110
|
+
signedAttach.addJws(jws);
|
|
111
|
+
return signedAttach;
|
|
112
|
+
}
|
|
113
|
+
async getSignedAttachmentPayload(agentContext, signedAttachment) {
|
|
114
|
+
const jws = signedAttachment.data.jws;
|
|
115
|
+
if (!jws) throw new CredoError("Missing jws in signed attachment");
|
|
116
|
+
if (!jws.protected) throw new CredoError("Missing protected header in signed attachment");
|
|
117
|
+
if (!signedAttachment.data.base64) throw new CredoError("Missing payload in signed attachment");
|
|
118
|
+
const { isValid } = await agentContext.dependencyManager.resolve(JwsService).verifyJws(agentContext, {
|
|
119
|
+
jws: {
|
|
120
|
+
header: jws.header,
|
|
121
|
+
protected: jws.protected,
|
|
122
|
+
signature: jws.signature,
|
|
123
|
+
payload: signedAttachment.data.base64
|
|
124
|
+
},
|
|
125
|
+
allowedJwsSignerMethods: ["did"],
|
|
126
|
+
resolveJwsSigner: async ({ protectedHeader: { kid, alg } }) => {
|
|
127
|
+
if (!kid || typeof kid !== "string") throw new CredoError("Missing kid in protected header.");
|
|
128
|
+
if (!kid.startsWith("did:")) throw new CredoError("Only did is supported for kid identifier");
|
|
129
|
+
return {
|
|
130
|
+
alg,
|
|
131
|
+
method: "did",
|
|
132
|
+
didUrl: kid,
|
|
133
|
+
jwk: getPublicJwkFromVerificationMethod((await agentContext.dependencyManager.resolve(DidsApi).resolveDidDocument(kid)).dereferenceKey(kid))
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
if (!isValid) throw new CredoError("Failed to validate signature of signed attachment");
|
|
138
|
+
const payload = JsonEncoder.fromBase64(signedAttachment.data.base64);
|
|
139
|
+
if (!payload.nonce || typeof payload.nonce !== "string") throw new CredoError("Invalid payload in signed attachment");
|
|
140
|
+
return payload;
|
|
141
|
+
}
|
|
142
|
+
async acceptOffer(agentContext, { credentialExchangeRecord, attachmentId, offerAttachment, credentialFormats }) {
|
|
143
|
+
const dataIntegrityFormat = credentialFormats?.dataIntegrity;
|
|
144
|
+
const credentialOffer = JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), DataIntegrityCredentialOffer);
|
|
145
|
+
let anonCredsLinkSecretDataIntegrityBindingProof;
|
|
146
|
+
const autoAcceptOfferWithAnonCredsLinkSecretMethod = credentialOffer.bindingRequired && !dataIntegrityFormat?.didCommSignedAttachment && credentialOffer.bindingMethod?.anoncredsLinkSecret;
|
|
147
|
+
if (dataIntegrityFormat?.anonCredsLinkSecret || autoAcceptOfferWithAnonCredsLinkSecretMethod) {
|
|
148
|
+
if (!credentialOffer.bindingMethod?.anoncredsLinkSecret) throw new CredoError("Cannot request credential with a binding method that was not offered.");
|
|
149
|
+
const anonCredsHolderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
150
|
+
const credentialDefinitionId = credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId;
|
|
151
|
+
const credentialDefinitionReturn = await fetchCredentialDefinition(agentContext, credentialDefinitionId);
|
|
152
|
+
const { credentialRequest: anonCredsCredentialRequest, credentialRequestMetadata: anonCredsCredentialRequestMetadata } = await anonCredsHolderService.createCredentialRequest(agentContext, {
|
|
153
|
+
credentialOffer: {
|
|
154
|
+
schema_id: credentialDefinitionReturn.credentialDefinition.schemaId,
|
|
155
|
+
cred_def_id: credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId,
|
|
156
|
+
key_correctness_proof: credentialOffer.bindingMethod.anoncredsLinkSecret.keyCorrectnessProof,
|
|
157
|
+
nonce: credentialOffer.bindingMethod.anoncredsLinkSecret.nonce
|
|
158
|
+
},
|
|
159
|
+
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
160
|
+
linkSecretId: dataIntegrityFormat?.anonCredsLinkSecret?.linkSecretId
|
|
161
|
+
});
|
|
162
|
+
if (!anonCredsCredentialRequest.entropy) throw new CredoError("Missing entropy for anonCredsCredentialRequest");
|
|
163
|
+
anonCredsLinkSecretDataIntegrityBindingProof = anonCredsCredentialRequest;
|
|
164
|
+
credentialExchangeRecord.metadata.set(AnonCredsCredentialMetadataKey, {
|
|
165
|
+
credentialDefinitionId: credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId,
|
|
166
|
+
schemaId: credentialDefinitionReturn.credentialDefinition.schemaId
|
|
167
|
+
});
|
|
168
|
+
credentialExchangeRecord.metadata.set(AnonCredsCredentialRequestMetadataKey, anonCredsCredentialRequestMetadata);
|
|
169
|
+
}
|
|
170
|
+
let didCommSignedAttachmentBindingProof;
|
|
171
|
+
let didCommSignedAttachment;
|
|
172
|
+
if (dataIntegrityFormat?.didCommSignedAttachment) {
|
|
173
|
+
if (!credentialOffer.bindingMethod?.didcommSignedAttachment) throw new CredoError("Cannot request credential with a binding method that was not offered.");
|
|
174
|
+
didCommSignedAttachment = await this.createSignedAttachment(agentContext, { nonce: credentialOffer.bindingMethod.didcommSignedAttachment.nonce }, dataIntegrityFormat.didCommSignedAttachment, credentialOffer.bindingMethod.didcommSignedAttachment.algsSupported);
|
|
175
|
+
didCommSignedAttachmentBindingProof = { attachment_id: didCommSignedAttachment.id };
|
|
176
|
+
}
|
|
177
|
+
const bindingProof = !anonCredsLinkSecretDataIntegrityBindingProof && !didCommSignedAttachmentBindingProof ? void 0 : {
|
|
178
|
+
anoncreds_link_secret: anonCredsLinkSecretDataIntegrityBindingProof,
|
|
179
|
+
didcomm_signed_attachment: didCommSignedAttachmentBindingProof
|
|
180
|
+
};
|
|
181
|
+
if (credentialOffer.bindingRequired && !bindingProof) throw new CredoError("Missing required binding proof");
|
|
182
|
+
const dataModelVersion = dataIntegrityFormat?.dataModelVersion ?? credentialOffer.dataModelVersionsSupported[0];
|
|
183
|
+
if (!credentialOffer.dataModelVersionsSupported.includes(dataModelVersion)) throw new CredoError("Cannot request credential with a data model version that was not offered.");
|
|
184
|
+
const credentialRequest = {
|
|
185
|
+
data_model_version: dataModelVersion,
|
|
186
|
+
binding_proof: bindingProof
|
|
187
|
+
};
|
|
188
|
+
const format = new DidCommCredentialFormatSpec({
|
|
189
|
+
attachmentId,
|
|
190
|
+
format: W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST
|
|
191
|
+
});
|
|
192
|
+
return {
|
|
193
|
+
format,
|
|
194
|
+
attachment: this.getFormatData(credentialRequest, format.attachmentId),
|
|
195
|
+
appendAttachments: didCommSignedAttachment ? [didCommSignedAttachment] : void 0
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Starting from a request is not supported for anoncreds credentials, this method only throws an error.
|
|
200
|
+
*/
|
|
201
|
+
async createRequest() {
|
|
202
|
+
throw new CredoError("Starting from a request is not supported for w3c credentials");
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* We don't have any models to validate an anoncreds request object, for now this method does nothing
|
|
206
|
+
*/
|
|
207
|
+
async processRequest(_agentContext, _options) {}
|
|
208
|
+
async createCredentialWithAnonCredsDataIntegrityProof(agentContext, input) {
|
|
209
|
+
const { credentialExchangeRecord, anonCredsLinkSecretBindingMethod, anonCredsLinkSecretBindingProof, linkSecretMetadata, credentialSubjectId } = input;
|
|
210
|
+
const credentialAttributes = credentialExchangeRecord.credentialAttributes;
|
|
211
|
+
if (!credentialAttributes) throw new CredoError(`Missing required credential attribute values on credential record with id ${credentialExchangeRecord.id}`);
|
|
212
|
+
const credentialSubjectIdAttribute = credentialAttributes.find((ca) => ca.name === "id");
|
|
213
|
+
if (credentialSubjectId && credentialSubjectIdAttribute && credentialSubjectIdAttribute.value !== credentialSubjectId) throw new CredoError("Invalid credential subject id.");
|
|
214
|
+
if (!credentialSubjectIdAttribute && credentialSubjectId) credentialAttributes.push(new DidCommCredentialPreviewAttribute({
|
|
215
|
+
name: "id",
|
|
216
|
+
value: credentialSubjectId
|
|
217
|
+
}));
|
|
218
|
+
const anonCredsIssuerService = agentContext.dependencyManager.resolve(AnonCredsIssuerServiceSymbol);
|
|
219
|
+
const credentialDefinition = (await agentContext.dependencyManager.resolve(AnonCredsCredentialDefinitionRepository).getByCredentialDefinitionId(agentContext, linkSecretMetadata.credentialDefinitionId)).credentialDefinition.value;
|
|
220
|
+
let revocationRegistryDefinitionId;
|
|
221
|
+
let revocationRegistryIndex;
|
|
222
|
+
let revocationStatusList;
|
|
223
|
+
if (credentialDefinition.revocation) {
|
|
224
|
+
const { credentialRevocationId, revocationRegistryId } = linkSecretMetadata;
|
|
225
|
+
if (!credentialRevocationId || !revocationRegistryId) throw new CredoError("Revocation registry definition id and revocation index are mandatory to issue AnonCreds revocable credentials");
|
|
226
|
+
revocationRegistryDefinitionId = revocationRegistryId;
|
|
227
|
+
revocationRegistryIndex = Number(credentialRevocationId);
|
|
228
|
+
const revocationRegistryDefinitionPrivateRecord = await agentContext.dependencyManager.resolve(AnonCredsRevocationRegistryDefinitionPrivateRepository).getByRevocationRegistryDefinitionId(agentContext, revocationRegistryDefinitionId);
|
|
229
|
+
if (revocationRegistryDefinitionPrivateRecord.state !== AnonCredsRevocationRegistryState.Active) throw new CredoError(`Revocation registry ${revocationRegistryDefinitionId} is in ${revocationRegistryDefinitionPrivateRecord.state} state`);
|
|
230
|
+
revocationStatusList = (await fetchRevocationStatusList(agentContext, revocationRegistryDefinitionId, dateToTimestamp(/* @__PURE__ */ new Date()))).revocationStatusList;
|
|
231
|
+
}
|
|
232
|
+
const { credential } = await anonCredsIssuerService.createCredential(agentContext, {
|
|
233
|
+
credentialOffer: {
|
|
234
|
+
schema_id: linkSecretMetadata.schemaId,
|
|
235
|
+
cred_def_id: anonCredsLinkSecretBindingMethod.credentialDefinitionId,
|
|
236
|
+
key_correctness_proof: anonCredsLinkSecretBindingMethod.keyCorrectnessProof,
|
|
237
|
+
nonce: anonCredsLinkSecretBindingMethod.nonce
|
|
238
|
+
},
|
|
239
|
+
credentialRequest: anonCredsLinkSecretBindingProof,
|
|
240
|
+
credentialValues: convertAttributesToCredentialValues(credentialAttributes),
|
|
241
|
+
revocationRegistryDefinitionId,
|
|
242
|
+
revocationRegistryIndex,
|
|
243
|
+
revocationStatusList
|
|
244
|
+
});
|
|
245
|
+
const { credentialDefinition: anoncredsCredentialDefinition } = await fetchCredentialDefinition(agentContext, credential.cred_def_id);
|
|
246
|
+
return await agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol).legacyToW3cCredential(agentContext, {
|
|
247
|
+
credential,
|
|
248
|
+
issuerId: anoncredsCredentialDefinition.issuerId
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
async getSignatureMetadata(agentContext, offeredCredential, issuerVerificationMethod) {
|
|
252
|
+
const didDocument = await agentContext.dependencyManager.resolve(DidsApi).resolveDidDocument(offeredCredential.issuerId);
|
|
253
|
+
let verificationMethod;
|
|
254
|
+
if (issuerVerificationMethod) verificationMethod = didDocument.dereferenceKey(issuerVerificationMethod, ["authentication", "assertionMethod"]);
|
|
255
|
+
else {
|
|
256
|
+
const vms = didDocument.authentication ?? didDocument.assertionMethod ?? didDocument.verificationMethod;
|
|
257
|
+
if (!vms || vms.length === 0) throw new CredoError("Missing authenticationMethod, assertionMethod, and verificationMethods in did document");
|
|
258
|
+
if (typeof vms[0] === "string") verificationMethod = didDocument.dereferenceVerificationMethod(vms[0]);
|
|
259
|
+
else verificationMethod = vms[0];
|
|
260
|
+
}
|
|
261
|
+
const signatureSuite = agentContext.dependencyManager.resolve(SignatureSuiteRegistry).getByVerificationMethodType(verificationMethod.type);
|
|
262
|
+
if (!signatureSuite) throw new CredoError(`Could not find signature suite for verification method type ${verificationMethod.type}`);
|
|
263
|
+
return {
|
|
264
|
+
verificationMethod,
|
|
265
|
+
signatureSuite,
|
|
266
|
+
offeredCredential
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
async assertAndSetCredentialSubjectId(credential, credentialSubjectId) {
|
|
270
|
+
if (!credentialSubjectId) return credential;
|
|
271
|
+
if (Array.isArray(credential.credentialSubject)) throw new CredoError("Invalid credential subject relation. Cannot determine the subject to be updated.");
|
|
272
|
+
const subjectId = credential.credentialSubject.id;
|
|
273
|
+
if (subjectId && credentialSubjectId !== subjectId) throw new CredoError("Invalid credential subject id.");
|
|
274
|
+
if (!subjectId) credential.credentialSubject.id = credentialSubjectId;
|
|
275
|
+
return credential;
|
|
276
|
+
}
|
|
277
|
+
async signCredential(agentContext, credential, issuerVerificationMethod) {
|
|
278
|
+
const { signatureSuite, verificationMethod } = await this.getSignatureMetadata(agentContext, credential, issuerVerificationMethod);
|
|
279
|
+
const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService);
|
|
280
|
+
let credentialToBeSigned = credential;
|
|
281
|
+
if (credential instanceof W3cJsonLdVerifiableCredential) {
|
|
282
|
+
const { proof, ..._credentialToBeSigned } = credential;
|
|
283
|
+
credentialToBeSigned = _credentialToBeSigned;
|
|
284
|
+
}
|
|
285
|
+
const w3cJsonLdVerifiableCredential = await w3cCredentialService.signCredential(agentContext, {
|
|
286
|
+
format: ClaimFormat.LdpVc,
|
|
287
|
+
credential: credentialToBeSigned,
|
|
288
|
+
proofType: signatureSuite.proofType,
|
|
289
|
+
verificationMethod: verificationMethod.id
|
|
290
|
+
});
|
|
291
|
+
if (Array.isArray(w3cJsonLdVerifiableCredential.proof)) throw new CredoError("A newly signed credential can not have multiple proofs");
|
|
292
|
+
if (credential instanceof W3cJsonLdVerifiableCredential) {
|
|
293
|
+
const combinedProofs = Array.isArray(credential.proof) ? credential.proof : [credential.proof];
|
|
294
|
+
combinedProofs.push(w3cJsonLdVerifiableCredential.proof);
|
|
295
|
+
w3cJsonLdVerifiableCredential.proof = combinedProofs;
|
|
296
|
+
}
|
|
297
|
+
return w3cJsonLdVerifiableCredential;
|
|
298
|
+
}
|
|
299
|
+
async acceptRequest(agentContext, { credentialFormats, credentialExchangeRecord, attachmentId, offerAttachment, requestAttachment, requestAppendAttachments }) {
|
|
300
|
+
const dataIntegrityFormat = credentialFormats?.dataIntegrity;
|
|
301
|
+
const credentialOffer = JsonTransformer.fromJSON(offerAttachment?.getDataAsJson(), DataIntegrityCredentialOffer);
|
|
302
|
+
const assertedCredential = await this.assertAndSetCredentialSubjectId(JsonTransformer.fromJSON(credentialOffer.credential, W3cCredential), dataIntegrityFormat?.credentialSubjectId);
|
|
303
|
+
const credentialRequest = requestAttachment.getDataAsJson();
|
|
304
|
+
if (!credentialRequest) throw new CredoError("Missing data integrity credential request in createCredential");
|
|
305
|
+
let signedCredential;
|
|
306
|
+
if (credentialRequest.binding_proof?.anoncreds_link_secret) {
|
|
307
|
+
if (!credentialOffer.bindingMethod?.anoncredsLinkSecret) throw new CredoError("Cannot issue credential with a binding method that was not offered");
|
|
308
|
+
const linkSecretMetadata = credentialExchangeRecord.metadata.get(AnonCredsCredentialMetadataKey);
|
|
309
|
+
if (!linkSecretMetadata) throw new CredoError("Missing anoncreds link secret metadata");
|
|
310
|
+
signedCredential = await this.createCredentialWithAnonCredsDataIntegrityProof(agentContext, {
|
|
311
|
+
credentialExchangeRecord,
|
|
312
|
+
anonCredsLinkSecretBindingMethod: credentialOffer.bindingMethod.anoncredsLinkSecret,
|
|
313
|
+
linkSecretMetadata,
|
|
314
|
+
anonCredsLinkSecretBindingProof: credentialRequest.binding_proof.anoncreds_link_secret,
|
|
315
|
+
credentialSubjectId: dataIntegrityFormat?.credentialSubjectId
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
if (credentialRequest.binding_proof?.didcomm_signed_attachment) {
|
|
319
|
+
if (!credentialOffer.bindingMethod?.didcommSignedAttachment) throw new CredoError("Cannot issue credential with a binding method that was not offered");
|
|
320
|
+
const bindingProofAttachment = requestAppendAttachments?.find((attachments) => attachments.id === credentialRequest.binding_proof?.didcomm_signed_attachment?.attachment_id);
|
|
321
|
+
if (!bindingProofAttachment) throw new CredoError("Missing binding proof attachment");
|
|
322
|
+
const { nonce } = await this.getSignedAttachmentPayload(agentContext, bindingProofAttachment);
|
|
323
|
+
if (nonce !== credentialOffer.bindingMethod.didcommSignedAttachment.nonce) throw new CredoError("Invalid nonce in signed attachment");
|
|
324
|
+
signedCredential = await this.signCredential(agentContext, signedCredential ?? assertedCredential, dataIntegrityFormat?.issuerVerificationMethod);
|
|
325
|
+
}
|
|
326
|
+
if (!credentialRequest.binding_proof?.anoncreds_link_secret && !credentialRequest.binding_proof?.didcomm_signed_attachment) signedCredential = await this.signCredential(agentContext, assertedCredential);
|
|
327
|
+
const format = new DidCommCredentialFormatSpec({
|
|
328
|
+
attachmentId,
|
|
329
|
+
format: W3C_DATA_INTEGRITY_CREDENTIAL
|
|
330
|
+
});
|
|
331
|
+
return {
|
|
332
|
+
format,
|
|
333
|
+
attachment: this.getFormatData({ credential: JsonTransformer.toJSON(signedCredential) }, format.attachmentId)
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
async storeAnonCredsCredential(agentContext, credentialJson, credentialExchangeRecord, linkSecretRequestMetadata) {
|
|
337
|
+
if (!credentialExchangeRecord.credentialAttributes) throw new CredoError("Missing credential attributes on credential record. Unable to check credential attributes");
|
|
338
|
+
const anonCredsHolderService = agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol);
|
|
339
|
+
const legacyAnonCredsCredential = await anonCredsHolderService.w3cToLegacyCredential(agentContext, { credential: JsonTransformer.fromJSON(credentialJson, W3cJsonLdVerifiableCredential) });
|
|
340
|
+
const { schema_id: schemaId, cred_def_id: credentialDefinitionId, rev_reg_id: revocationRegistryId } = legacyAnonCredsCredential;
|
|
341
|
+
const schemaReturn = await fetchSchema(agentContext, schemaId);
|
|
342
|
+
const credentialDefinitionReturn = await fetchCredentialDefinition(agentContext, credentialDefinitionId);
|
|
343
|
+
const revocationRegistryDefinitionReturn = revocationRegistryId ? await fetchRevocationRegistryDefinition(agentContext, revocationRegistryId) : void 0;
|
|
344
|
+
const w3cJsonLdVerifiableCredential = await anonCredsHolderService.legacyToW3cCredential(agentContext, {
|
|
345
|
+
credential: legacyAnonCredsCredential,
|
|
346
|
+
issuerId: credentialJson.issuer,
|
|
347
|
+
processOptions: {
|
|
348
|
+
credentialRequestMetadata: linkSecretRequestMetadata,
|
|
349
|
+
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
350
|
+
revocationRegistryDefinition: revocationRegistryDefinitionReturn?.revocationRegistryDefinition
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
const w3cCredentialRecordId = await anonCredsHolderService.storeCredential(agentContext, {
|
|
354
|
+
credential: w3cJsonLdVerifiableCredential,
|
|
355
|
+
schema: schemaReturn.schema,
|
|
356
|
+
credentialDefinitionId,
|
|
357
|
+
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
358
|
+
credentialRequestMetadata: linkSecretRequestMetadata,
|
|
359
|
+
revocationRegistry: revocationRegistryDefinitionReturn ? {
|
|
360
|
+
id: revocationRegistryId,
|
|
361
|
+
definition: revocationRegistryDefinitionReturn?.revocationRegistryDefinition
|
|
362
|
+
} : void 0
|
|
363
|
+
});
|
|
364
|
+
const w3cCredentialRecord = await agentContext.dependencyManager.resolve(W3cCredentialService).getCredentialRecordById(agentContext, w3cCredentialRecordId);
|
|
365
|
+
if (revocationRegistryId) {
|
|
366
|
+
const linkSecretMetadata = credentialExchangeRecord.metadata.get(AnonCredsCredentialMetadataKey);
|
|
367
|
+
if (!linkSecretMetadata) throw new CredoError("Missing link secret metadata");
|
|
368
|
+
const anonCredsTags = await getAnonCredsTagsFromRecord(w3cCredentialRecord);
|
|
369
|
+
if (!anonCredsTags) throw new CredoError("Missing anoncreds tags on credential record.");
|
|
370
|
+
linkSecretMetadata.revocationRegistryId = revocationRegistryDefinitionReturn?.revocationRegistryDefinitionId;
|
|
371
|
+
linkSecretMetadata.credentialRevocationId = anonCredsTags.anonCredsCredentialRevocationId?.toString();
|
|
372
|
+
credentialExchangeRecord.metadata.set(AnonCredsCredentialMetadataKey, linkSecretMetadata);
|
|
373
|
+
}
|
|
374
|
+
return w3cCredentialRecord;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Processes an incoming credential - retrieve metadata, retrieve payload and store it in wallet
|
|
378
|
+
* @param options the issue credential message wrapped inside this object
|
|
379
|
+
* @param credentialExchangeRecord the credential exchange record for this credential
|
|
380
|
+
*/
|
|
381
|
+
async processCredential(agentContext, { credentialExchangeRecord, attachment, requestAttachment, offerAttachment }) {
|
|
382
|
+
const offeredCredentialJson = JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), DataIntegrityCredentialOffer).credential;
|
|
383
|
+
const credentialRequest = requestAttachment.getDataAsJson();
|
|
384
|
+
if (!credentialRequest) throw new CredoError("Missing data integrity credential request in createCredential");
|
|
385
|
+
if (!credentialExchangeRecord.credentialAttributes) throw new CredoError("Missing credential attributes on credential record.");
|
|
386
|
+
const { credential: credentialJson } = attachment.getDataAsJson();
|
|
387
|
+
if (Array.isArray(offeredCredentialJson.credentialSubject)) throw new CredoError("Invalid credential subject. Multiple credential subjects are not yet supported.");
|
|
388
|
+
if (!Object.entries(offeredCredentialJson.credentialSubject).every(([key, offeredValue]) => {
|
|
389
|
+
const receivedValue = credentialJson.credentialSubject[key];
|
|
390
|
+
if (!offeredValue || !receivedValue) return false;
|
|
391
|
+
if (typeof offeredValue === "number" || typeof receivedValue === "number") return offeredValue.toString() === receivedValue.toString();
|
|
392
|
+
return deepEquality(offeredValue, receivedValue);
|
|
393
|
+
})) throw new CredoError("Received invalid credential. Received credential subject does not match the offered credential subject.");
|
|
394
|
+
const credentialVersion = this.getCredentialVersion(credentialJson);
|
|
395
|
+
if (!deepEquality(credentialJson, {
|
|
396
|
+
...offeredCredentialJson,
|
|
397
|
+
"@context": credentialJson["@context"],
|
|
398
|
+
issuer: offeredCredentialJson.issuer ?? credentialJson.issuer,
|
|
399
|
+
credentialSubject: credentialJson.credentialSubject,
|
|
400
|
+
...credentialVersion === "1.1" && { issuanceDate: credentialJson.issuanceDate },
|
|
401
|
+
...credentialVersion === "2.0" && { validFrom: credentialJson.validFrom },
|
|
402
|
+
...offeredCredentialJson.credentialStatus && { credentialStatus: credentialJson.credentialStatus },
|
|
403
|
+
proof: credentialJson.proof
|
|
404
|
+
})) throw new CredoError("Received invalid credential. Received credential does not match the offered credential");
|
|
405
|
+
let w3cCredentialRecord;
|
|
406
|
+
if (credentialRequest.binding_proof?.anoncreds_link_secret) {
|
|
407
|
+
const linkSecretRequestMetadata = credentialExchangeRecord.metadata.get(AnonCredsCredentialRequestMetadataKey);
|
|
408
|
+
if (!linkSecretRequestMetadata) throw new CredoError("Missing link secret request metadata");
|
|
409
|
+
const integrityProtectedFields = [
|
|
410
|
+
"@context",
|
|
411
|
+
"issuer",
|
|
412
|
+
"type",
|
|
413
|
+
"credentialSubject",
|
|
414
|
+
"validFrom",
|
|
415
|
+
"issuanceDate"
|
|
416
|
+
];
|
|
417
|
+
if (Object.keys(offeredCredentialJson).some((key) => !integrityProtectedFields.includes(key) && key !== "proof")) throw new CredoError("Credential offer contains non anoncreds integrity protected fields.");
|
|
418
|
+
if (!Array.isArray(offeredCredentialJson.type) || offeredCredentialJson?.type.length !== 1) throw new CredoError(`Invalid credential type. Only single credential type 'VerifiableCredential' is supported`);
|
|
419
|
+
w3cCredentialRecord = await this.storeAnonCredsCredential(agentContext, credentialJson, credentialExchangeRecord, linkSecretRequestMetadata);
|
|
420
|
+
await this.assertCredentialAttributesMatchSchemaAttributes(agentContext, w3cCredentialRecord.firstCredential, getAnonCredsTagsFromRecord(w3cCredentialRecord)?.anonCredsSchemaId, true);
|
|
421
|
+
} else {
|
|
422
|
+
const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService);
|
|
423
|
+
const w3cJsonLdVerifiableCredential = JsonTransformer.fromJSON(credentialJson, W3cJsonLdVerifiableCredential);
|
|
424
|
+
w3cCredentialRecord = await w3cCredentialService.storeCredential(agentContext, { record: W3cCredentialRecord.fromCredential(w3cJsonLdVerifiableCredential) });
|
|
425
|
+
}
|
|
426
|
+
credentialExchangeRecord.credentials.push({
|
|
427
|
+
credentialRecordType: this.credentialRecordType,
|
|
428
|
+
credentialRecordId: w3cCredentialRecord.id
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
supportsFormat(format) {
|
|
432
|
+
return [
|
|
433
|
+
W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST,
|
|
434
|
+
W3C_DATA_INTEGRITY_CREDENTIAL_OFFER,
|
|
435
|
+
W3C_DATA_INTEGRITY_CREDENTIAL
|
|
436
|
+
].includes(format);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Gets the attachment object for a given attachmentId. We need to get out the correct attachmentId for
|
|
440
|
+
* anoncreds and then find the corresponding attachment (if there is one)
|
|
441
|
+
* @param formats the formats object containing the attachmentId
|
|
442
|
+
* @param messageAttachments the attachments containing the payload
|
|
443
|
+
* @returns The DidCommAttachment if found or undefined
|
|
444
|
+
*
|
|
445
|
+
*/
|
|
446
|
+
getAttachment(formats, messageAttachments) {
|
|
447
|
+
const supportedAttachmentIds = formats.filter((f) => this.supportsFormat(f.format)).map((f) => f.attachmentId);
|
|
448
|
+
return messageAttachments.find((attachment) => supportedAttachmentIds.includes(attachment.id));
|
|
449
|
+
}
|
|
450
|
+
async deleteCredentialById(agentContext, credentialRecordId) {
|
|
451
|
+
await agentContext.dependencyManager.resolve(AnonCredsHolderServiceSymbol).deleteCredential(agentContext, credentialRecordId);
|
|
452
|
+
}
|
|
453
|
+
async shouldAutoRespondToProposal(_agentContext, options) {
|
|
454
|
+
throw new CredoError("Not implemented");
|
|
455
|
+
}
|
|
456
|
+
async shouldAutoRespondToOffer(_agentContext, { offerAttachment }) {
|
|
457
|
+
if (!JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), DataIntegrityCredentialOffer).bindingRequired) return true;
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
async shouldAutoRespondToRequest(_agentContext, { offerAttachment, requestAttachment }) {
|
|
461
|
+
const credentialOffer = JsonTransformer.fromJSON(offerAttachment?.getDataAsJson(), DataIntegrityCredentialOffer);
|
|
462
|
+
const credentialRequest = requestAttachment.getDataAsJson();
|
|
463
|
+
if (!credentialOffer.bindingRequired && !credentialRequest.binding_proof?.anoncreds_link_secret && !credentialRequest.binding_proof?.didcomm_signed_attachment) return true;
|
|
464
|
+
if (credentialOffer.bindingRequired && !credentialRequest.binding_proof?.anoncreds_link_secret && !credentialRequest.binding_proof?.didcomm_signed_attachment) return false;
|
|
465
|
+
if (credentialRequest.binding_proof?.didcomm_signed_attachment) try {
|
|
466
|
+
const subjectJson = credentialOffer.credential.credentialSubject;
|
|
467
|
+
if (JsonTransformer.fromJSON(subjectJson, W3cCredentialSubject).id === void 0) return false;
|
|
468
|
+
} catch (_e) {
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
const validLinkSecretRequest = !credentialRequest.binding_proof?.anoncreds_link_secret || credentialRequest.binding_proof?.anoncreds_link_secret && credentialOffer.bindingMethod?.anoncredsLinkSecret;
|
|
472
|
+
const validDidCommSignedAttachmetRequest = !credentialRequest.binding_proof?.didcomm_signed_attachment || credentialRequest.binding_proof?.didcomm_signed_attachment && credentialOffer.bindingMethod?.didcommSignedAttachment;
|
|
473
|
+
return Boolean(validLinkSecretRequest && validDidCommSignedAttachmetRequest);
|
|
474
|
+
}
|
|
475
|
+
async shouldAutoRespondToCredential(_agentContext, options) {
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
async createDataIntegrityCredentialOffer(agentContext, credentialExchangeRecord, options) {
|
|
479
|
+
const { bindingRequired, credential, anonCredsLinkSecretBinding: anonCredsLinkSecretBindingMethodOptions, didCommSignedAttachmentBinding: didCommSignedAttachmentBindingMethodOptions } = options;
|
|
480
|
+
const dataModelVersionsSupported = ["1.1"];
|
|
481
|
+
const credentialJson = credential instanceof W3cCredential ? JsonTransformer.toJSON(credential) : credential;
|
|
482
|
+
const validW3cCredential = JsonTransformer.fromJSON(credentialJson, W3cCredential);
|
|
483
|
+
const previewAttributes = this.previewAttributesFromCredential(validW3cCredential);
|
|
484
|
+
let anonCredsLinkSecretBindingMethod;
|
|
485
|
+
if (anonCredsLinkSecretBindingMethodOptions) {
|
|
486
|
+
const { credentialDefinitionId, revocationRegistryDefinitionId, revocationRegistryIndex } = anonCredsLinkSecretBindingMethodOptions;
|
|
487
|
+
const anoncredsCredentialOffer = await agentContext.dependencyManager.resolve(AnonCredsIssuerServiceSymbol).createCredentialOffer(agentContext, { credentialDefinitionId });
|
|
488
|
+
const { credentialDefinition } = await agentContext.dependencyManager.resolve(AnonCredsCredentialDefinitionRepository).getByCredentialDefinitionId(agentContext, anoncredsCredentialOffer.cred_def_id);
|
|
489
|
+
if (credentialDefinition.value.revocation) {
|
|
490
|
+
if (!revocationRegistryDefinitionId || !revocationRegistryIndex) throw new CredoError("AnonCreds revocable credentials require revocationRegistryDefinitionId and revocationRegistryIndex");
|
|
491
|
+
credentialExchangeRecord.setTags({
|
|
492
|
+
anonCredsRevocationRegistryId: revocationRegistryDefinitionId,
|
|
493
|
+
anonCredsCredentialRevocationId: revocationRegistryIndex.toString()
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
await this.assertCredentialAttributesMatchSchemaAttributes(agentContext, validW3cCredential, credentialDefinition.schemaId, false);
|
|
497
|
+
anonCredsLinkSecretBindingMethod = {
|
|
498
|
+
credentialDefinitionId: anoncredsCredentialOffer.cred_def_id,
|
|
499
|
+
keyCorrectnessProof: anoncredsCredentialOffer.key_correctness_proof,
|
|
500
|
+
nonce: anoncredsCredentialOffer.nonce
|
|
501
|
+
};
|
|
502
|
+
credentialExchangeRecord.metadata.set(AnonCredsCredentialMetadataKey, {
|
|
503
|
+
schemaId: anoncredsCredentialOffer.schema_id,
|
|
504
|
+
credentialDefinitionId,
|
|
505
|
+
credentialRevocationId: revocationRegistryIndex?.toString(),
|
|
506
|
+
revocationRegistryId: revocationRegistryDefinitionId
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
let didCommSignedAttachmentBindingMethod;
|
|
510
|
+
if (didCommSignedAttachmentBindingMethodOptions) {
|
|
511
|
+
const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi);
|
|
512
|
+
const { didMethodsSupported, algsSupported } = didCommSignedAttachmentBindingMethodOptions;
|
|
513
|
+
didCommSignedAttachmentBindingMethod = {
|
|
514
|
+
didMethodsSupported: didMethodsSupported ?? agentContext.dependencyManager.resolve(DidsApi).supportedResolverMethods,
|
|
515
|
+
algsSupported: algsSupported ?? this.getSupportedJwaSignatureAlgorithms(agentContext),
|
|
516
|
+
nonce: TypedArrayEncoder.toBase64URL(kms.randomBytes({ length: 32 }))
|
|
517
|
+
};
|
|
518
|
+
if (didCommSignedAttachmentBindingMethod.algsSupported.length === 0) throw new CredoError("No supported JWA signature algorithms found.");
|
|
519
|
+
if (didCommSignedAttachmentBindingMethod.didMethodsSupported.length === 0) throw new CredoError("No supported DID methods found.");
|
|
520
|
+
}
|
|
521
|
+
if (bindingRequired && !anonCredsLinkSecretBindingMethod && !didCommSignedAttachmentBindingMethod) throw new CredoError("Missing required binding method.");
|
|
522
|
+
return {
|
|
523
|
+
dataIntegrityCredentialOffer: new DataIntegrityCredentialOffer({
|
|
524
|
+
dataModelVersionsSupported,
|
|
525
|
+
bindingRequired,
|
|
526
|
+
bindingMethod: {
|
|
527
|
+
anoncredsLinkSecret: anonCredsLinkSecretBindingMethod,
|
|
528
|
+
didcommSignedAttachment: didCommSignedAttachmentBindingMethod
|
|
529
|
+
},
|
|
530
|
+
credential: credentialJson
|
|
531
|
+
}),
|
|
532
|
+
previewAttributes
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
previewAttributesFromCredential(credential) {
|
|
536
|
+
if (Array.isArray(credential.credentialSubject)) throw new CredoError("Credential subject must be an object.");
|
|
537
|
+
const claims = {
|
|
538
|
+
...credential.credentialSubject.claims,
|
|
539
|
+
...credential.credentialSubject.id && { id: credential.credentialSubject.id }
|
|
540
|
+
};
|
|
541
|
+
return Object.entries(claims).map(([key, value]) => {
|
|
542
|
+
return {
|
|
543
|
+
name: key,
|
|
544
|
+
value: value.toString()
|
|
545
|
+
};
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
async assertCredentialAttributesMatchSchemaAttributes(agentContext, credential, schemaId, credentialSubjectIdMustBeSet) {
|
|
549
|
+
const attributes = this.previewAttributesFromCredential(credential);
|
|
550
|
+
const schemaReturn = await fetchSchema(agentContext, schemaId);
|
|
551
|
+
const enhancedAttributes = [...attributes];
|
|
552
|
+
if (!credentialSubjectIdMustBeSet && schemaReturn.schema.attrNames.includes("id") && attributes.find((attr) => attr.name === "id") === void 0) enhancedAttributes.push({
|
|
553
|
+
name: "id",
|
|
554
|
+
value: "mock"
|
|
555
|
+
});
|
|
556
|
+
assertAttributesMatch(schemaReturn.schema, enhancedAttributes);
|
|
557
|
+
return { attributes };
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.
|
|
561
|
+
* It looks up the correct format identifier and encodes the data as a base64 attachment.
|
|
562
|
+
*
|
|
563
|
+
* @param data The data to include in the attach object
|
|
564
|
+
* @param id the attach id from the formats component of the message
|
|
565
|
+
*/
|
|
566
|
+
getFormatData(data, id) {
|
|
567
|
+
return new DidCommAttachment({
|
|
568
|
+
id,
|
|
569
|
+
mimeType: "application/json",
|
|
570
|
+
data: { base64: JsonEncoder.toBase64(data) }
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Returns the JWA Signature Algorithms that are supported by the agent.
|
|
575
|
+
*/
|
|
576
|
+
getSupportedJwaSignatureAlgorithms(agentContext) {
|
|
577
|
+
const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi);
|
|
578
|
+
return Object.values(Kms.KnownJwaSignatureAlgorithms).filter((algorithm) => kms.supportedBackendsForOperation({
|
|
579
|
+
operation: "sign",
|
|
580
|
+
algorithm
|
|
581
|
+
}).length > 0);
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
//#endregion
|
|
586
|
+
export { DataIntegrityDidCommCredentialFormatService };
|
|
587
|
+
//# sourceMappingURL=DataIntegrityDidCommCredentialFormatService.mjs.map
|