@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
|
@@ -1,773 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.DataIntegrityCredentialFormatService = void 0;
|
|
15
|
-
const core_1 = require("@credo-ts/core");
|
|
16
|
-
const repository_1 = require("../repository");
|
|
17
|
-
const services_1 = require("../services");
|
|
18
|
-
const utils_1 = require("../utils");
|
|
19
|
-
const credential_1 = require("../utils/credential");
|
|
20
|
-
const metadata_1 = require("../utils/metadata");
|
|
21
|
-
const w3cAnonCredsUtils_1 = require("../utils/w3cAnonCredsUtils");
|
|
22
|
-
const W3C_DATA_INTEGRITY_CREDENTIAL_OFFER = 'didcomm/w3c-di-vc-offer@v0.1';
|
|
23
|
-
const W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST = 'didcomm/w3c-di-vc-request@v0.1';
|
|
24
|
-
const W3C_DATA_INTEGRITY_CREDENTIAL = 'didcomm/w3c-di-vc@v0.1';
|
|
25
|
-
class DataIntegrityCredentialFormatService {
|
|
26
|
-
constructor() {
|
|
27
|
-
/** formatKey is the key used when calling agent.credentials.xxx with credentialFormats.anoncreds */
|
|
28
|
-
this.formatKey = 'dataIntegrity';
|
|
29
|
-
/**
|
|
30
|
-
* credentialRecordType is the type of record that stores the credential. It is stored in the credential
|
|
31
|
-
* record binding in the credential exchange record.
|
|
32
|
-
*/
|
|
33
|
-
this.credentialRecordType = 'w3c';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create a {@link AttachmentFormats} object dependent on the message type.
|
|
37
|
-
*
|
|
38
|
-
* @param options The object containing all the options for the proposed credential
|
|
39
|
-
* @returns object containing associated attachment, format and optionally the credential preview
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
async createProposal(
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
|
-
agentContext,
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
|
-
{ credentialFormats, credentialRecord }) {
|
|
47
|
-
throw new core_1.CredoError('Not defined');
|
|
48
|
-
}
|
|
49
|
-
async processProposal(
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
|
-
agentContext,
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
|
-
{ attachment }) {
|
|
54
|
-
throw new core_1.CredoError('Not defined');
|
|
55
|
-
}
|
|
56
|
-
async acceptProposal(
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
58
|
-
agentContext,
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
60
|
-
input) {
|
|
61
|
-
throw new core_1.CredoError('Not defined');
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Create a credential attachment format for a credential request.
|
|
65
|
-
*
|
|
66
|
-
* @param options The object containing all the options for the credential offer
|
|
67
|
-
* @returns object containing associated attachment, formats and offersAttach elements
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
async createOffer(agentContext, { credentialFormats, credentialRecord, attachmentId, }) {
|
|
71
|
-
const dataIntegrityFormat = credentialFormats.dataIntegrity;
|
|
72
|
-
if (!dataIntegrityFormat)
|
|
73
|
-
throw new core_1.CredoError('Missing data integrity credential format data');
|
|
74
|
-
const format = new core_1.CredentialFormatSpec({
|
|
75
|
-
attachmentId: attachmentId,
|
|
76
|
-
format: W3C_DATA_INTEGRITY_CREDENTIAL_OFFER,
|
|
77
|
-
});
|
|
78
|
-
const credential = dataIntegrityFormat.credential;
|
|
79
|
-
if ('proof' in credential)
|
|
80
|
-
throw new core_1.CredoError('The offered credential MUST NOT contain any proofs.');
|
|
81
|
-
const { dataIntegrityCredentialOffer, previewAttributes } = await this.createDataIntegrityCredentialOffer(agentContext, credentialRecord, dataIntegrityFormat);
|
|
82
|
-
const attachment = this.getFormatData(core_1.JsonTransformer.toJSON(dataIntegrityCredentialOffer), format.attachmentId);
|
|
83
|
-
return { format, attachment, previewAttributes };
|
|
84
|
-
}
|
|
85
|
-
getCredentialVersion(credentialJson) {
|
|
86
|
-
const context = credentialJson['@context'];
|
|
87
|
-
if (!context || !Array.isArray(context))
|
|
88
|
-
throw new core_1.CredoError('Invalid @context in credential offer');
|
|
89
|
-
const isV1Credential = context.find((c) => c === 'https://www.w3.org/2018/credentials/v1');
|
|
90
|
-
const isV2Credential = context.find((c) => c === 'https://www.w3.org/ns/credentials/v2');
|
|
91
|
-
if (isV1Credential)
|
|
92
|
-
return '1.1';
|
|
93
|
-
else if (isV2Credential)
|
|
94
|
-
throw new core_1.CredoError('Received w3c credential with unsupported version 2.0.');
|
|
95
|
-
else
|
|
96
|
-
throw new core_1.CredoError('Cannot determine credential version from @context');
|
|
97
|
-
}
|
|
98
|
-
async processOffer(agentContext, { attachment, credentialRecord }) {
|
|
99
|
-
var _a, _b, _c;
|
|
100
|
-
agentContext.config.logger.debug(`Processing data integrity credential offer for credential record ${credentialRecord.id}`);
|
|
101
|
-
const dataIntegrityCredentialOffer = core_1.JsonTransformer.fromJSON(attachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
102
|
-
const credentialJson = dataIntegrityCredentialOffer.credential;
|
|
103
|
-
const credentialVersion = this.getCredentialVersion(credentialJson);
|
|
104
|
-
const credentialToBeValidated = Object.assign(Object.assign(Object.assign({}, credentialJson), { issuer: (_a = credentialJson.issuer) !== null && _a !== void 0 ? _a : 'https://example.com' }), (credentialVersion === '1.1'
|
|
105
|
-
? { issuanceDate: new Date().toISOString() }
|
|
106
|
-
: { validFrom: new Date().toISOString() }));
|
|
107
|
-
core_1.JsonTransformer.fromJSON(credentialToBeValidated, core_1.W3cCredential);
|
|
108
|
-
const missingBindingMethod = dataIntegrityCredentialOffer.bindingRequired &&
|
|
109
|
-
!((_b = dataIntegrityCredentialOffer.bindingMethod) === null || _b === void 0 ? void 0 : _b.anoncredsLinkSecret) &&
|
|
110
|
-
!((_c = dataIntegrityCredentialOffer.bindingMethod) === null || _c === void 0 ? void 0 : _c.didcommSignedAttachment);
|
|
111
|
-
if (missingBindingMethod) {
|
|
112
|
-
throw new core_1.ProblemReportError('Invalid credential offer. Missing binding method.', {
|
|
113
|
-
problemCode: core_1.CredentialProblemReportReason.IssuanceAbandoned,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async createSignedAttachment(agentContext, data, options, issuerSupportedAlgs) {
|
|
118
|
-
const { alg, kid } = options;
|
|
119
|
-
if (!kid.startsWith('did:')) {
|
|
120
|
-
throw new core_1.CredoError(`kid '${kid}' is not a DID. Only dids are supported for kid`);
|
|
121
|
-
}
|
|
122
|
-
else if (!kid.includes('#')) {
|
|
123
|
-
throw new core_1.CredoError(`kid '${kid}' does not contain a fragment. kid MUST point to a specific key in the did document.`);
|
|
124
|
-
}
|
|
125
|
-
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
126
|
-
const didDocument = await didsApi.resolveDidDocument(kid);
|
|
127
|
-
const verificationMethod = didDocument.dereferenceKey(kid);
|
|
128
|
-
const key = (0, core_1.getKeyFromVerificationMethod)(verificationMethod);
|
|
129
|
-
const jwk = (0, core_1.getJwkFromKey)(key);
|
|
130
|
-
if (alg && !jwk.supportsSignatureAlgorithm(alg)) {
|
|
131
|
-
throw new core_1.CredoError(`key type '${jwk.keyType}', does not support the JWS signature alg '${alg}'`);
|
|
132
|
-
}
|
|
133
|
-
const signingAlg = issuerSupportedAlgs.find((supportedAlg) => jwk.supportsSignatureAlgorithm(supportedAlg) && (alg === undefined || alg === supportedAlg));
|
|
134
|
-
if (!signingAlg)
|
|
135
|
-
throw new core_1.CredoError('No signing algorithm supported by the issuer found');
|
|
136
|
-
const jwsService = agentContext.dependencyManager.resolve(core_1.JwsService);
|
|
137
|
-
const jws = await jwsService.createJws(agentContext, {
|
|
138
|
-
key,
|
|
139
|
-
header: {},
|
|
140
|
-
payload: new core_1.JwtPayload({ additionalClaims: { nonce: data.nonce } }),
|
|
141
|
-
protectedHeaderOptions: { alg: signingAlg, kid },
|
|
142
|
-
});
|
|
143
|
-
const signedAttach = new core_1.Attachment({
|
|
144
|
-
mimeType: 'application/json',
|
|
145
|
-
data: new core_1.AttachmentData({ base64: jws.payload }),
|
|
146
|
-
});
|
|
147
|
-
signedAttach.addJws(jws);
|
|
148
|
-
return signedAttach;
|
|
149
|
-
}
|
|
150
|
-
async getSignedAttachmentPayload(agentContext, signedAttachment) {
|
|
151
|
-
const jws = signedAttachment.data.jws;
|
|
152
|
-
if (!jws)
|
|
153
|
-
throw new core_1.CredoError('Missing jws in signed attachment');
|
|
154
|
-
if (!jws.protected)
|
|
155
|
-
throw new core_1.CredoError('Missing protected header in signed attachment');
|
|
156
|
-
if (!signedAttachment.data.base64)
|
|
157
|
-
throw new core_1.CredoError('Missing payload in signed attachment');
|
|
158
|
-
const jwsService = agentContext.dependencyManager.resolve(core_1.JwsService);
|
|
159
|
-
const { isValid } = await jwsService.verifyJws(agentContext, {
|
|
160
|
-
jws: {
|
|
161
|
-
header: jws.header,
|
|
162
|
-
protected: jws.protected,
|
|
163
|
-
signature: jws.signature,
|
|
164
|
-
payload: signedAttachment.data.base64,
|
|
165
|
-
},
|
|
166
|
-
jwkResolver: async ({ protectedHeader: { kid } }) => {
|
|
167
|
-
if (!kid || typeof kid !== 'string')
|
|
168
|
-
throw new core_1.CredoError('Missing kid in protected header.');
|
|
169
|
-
if (!kid.startsWith('did:'))
|
|
170
|
-
throw new core_1.CredoError('Only did is supported for kid identifier');
|
|
171
|
-
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
172
|
-
const didDocument = await didsApi.resolveDidDocument(kid);
|
|
173
|
-
const verificationMethod = didDocument.dereferenceKey(kid);
|
|
174
|
-
const key = (0, core_1.getKeyFromVerificationMethod)(verificationMethod);
|
|
175
|
-
return (0, core_1.getJwkFromKey)(key);
|
|
176
|
-
},
|
|
177
|
-
});
|
|
178
|
-
if (!isValid)
|
|
179
|
-
throw new core_1.CredoError('Failed to validate signature of signed attachment');
|
|
180
|
-
const payload = core_1.JsonEncoder.fromBase64(signedAttachment.data.base64);
|
|
181
|
-
if (!payload.nonce || typeof payload.nonce !== 'string') {
|
|
182
|
-
throw new core_1.CredoError('Invalid payload in signed attachment');
|
|
183
|
-
}
|
|
184
|
-
return payload;
|
|
185
|
-
}
|
|
186
|
-
async acceptOffer(agentContext, { credentialRecord, attachmentId, offerAttachment, credentialFormats, }) {
|
|
187
|
-
var _a, _b, _c, _d, _e;
|
|
188
|
-
const dataIntegrityFormat = credentialFormats === null || credentialFormats === void 0 ? void 0 : credentialFormats.dataIntegrity;
|
|
189
|
-
const credentialOffer = core_1.JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
190
|
-
let anonCredsLinkSecretDataIntegrityBindingProof = undefined;
|
|
191
|
-
const autoAcceptOfferWithAnonCredsLinkSecretMethod = credentialOffer.bindingRequired &&
|
|
192
|
-
!(dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.didCommSignedAttachment) &&
|
|
193
|
-
((_a = credentialOffer.bindingMethod) === null || _a === void 0 ? void 0 : _a.anoncredsLinkSecret);
|
|
194
|
-
if ((dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.anonCredsLinkSecret) || autoAcceptOfferWithAnonCredsLinkSecretMethod) {
|
|
195
|
-
if (!((_b = credentialOffer.bindingMethod) === null || _b === void 0 ? void 0 : _b.anoncredsLinkSecret)) {
|
|
196
|
-
throw new core_1.CredoError('Cannot request credential with a binding method that was not offered.');
|
|
197
|
-
}
|
|
198
|
-
const anonCredsHolderService = agentContext.dependencyManager.resolve(services_1.AnonCredsHolderServiceSymbol);
|
|
199
|
-
const credentialDefinitionId = credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId;
|
|
200
|
-
const credentialDefinitionReturn = await (0, utils_1.fetchCredentialDefinition)(agentContext, credentialDefinitionId);
|
|
201
|
-
const { credentialRequest: anonCredsCredentialRequest, credentialRequestMetadata: anonCredsCredentialRequestMetadata, } = await anonCredsHolderService.createCredentialRequest(agentContext, {
|
|
202
|
-
credentialOffer: {
|
|
203
|
-
schema_id: credentialDefinitionReturn.credentialDefinition.schemaId,
|
|
204
|
-
cred_def_id: credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId,
|
|
205
|
-
key_correctness_proof: credentialOffer.bindingMethod.anoncredsLinkSecret.keyCorrectnessProof,
|
|
206
|
-
nonce: credentialOffer.bindingMethod.anoncredsLinkSecret.nonce,
|
|
207
|
-
},
|
|
208
|
-
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
209
|
-
linkSecretId: (_c = dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.anonCredsLinkSecret) === null || _c === void 0 ? void 0 : _c.linkSecretId,
|
|
210
|
-
});
|
|
211
|
-
if (!anonCredsCredentialRequest.entropy)
|
|
212
|
-
throw new core_1.CredoError('Missing entropy for anonCredsCredentialRequest');
|
|
213
|
-
anonCredsLinkSecretDataIntegrityBindingProof =
|
|
214
|
-
anonCredsCredentialRequest;
|
|
215
|
-
credentialRecord.metadata.set(metadata_1.AnonCredsCredentialMetadataKey, {
|
|
216
|
-
credentialDefinitionId: credentialOffer.bindingMethod.anoncredsLinkSecret.credentialDefinitionId,
|
|
217
|
-
schemaId: credentialDefinitionReturn.credentialDefinition.schemaId,
|
|
218
|
-
});
|
|
219
|
-
credentialRecord.metadata.set(metadata_1.AnonCredsCredentialRequestMetadataKey, anonCredsCredentialRequestMetadata);
|
|
220
|
-
}
|
|
221
|
-
let didCommSignedAttachmentBindingProof = undefined;
|
|
222
|
-
let didCommSignedAttachment = undefined;
|
|
223
|
-
if (dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.didCommSignedAttachment) {
|
|
224
|
-
if (!((_d = credentialOffer.bindingMethod) === null || _d === void 0 ? void 0 : _d.didcommSignedAttachment)) {
|
|
225
|
-
throw new core_1.CredoError('Cannot request credential with a binding method that was not offered.');
|
|
226
|
-
}
|
|
227
|
-
didCommSignedAttachment = await this.createSignedAttachment(agentContext, { nonce: credentialOffer.bindingMethod.didcommSignedAttachment.nonce }, dataIntegrityFormat.didCommSignedAttachment, credentialOffer.bindingMethod.didcommSignedAttachment.algsSupported);
|
|
228
|
-
didCommSignedAttachmentBindingProof = { attachment_id: didCommSignedAttachment.id };
|
|
229
|
-
}
|
|
230
|
-
const bindingProof = !anonCredsLinkSecretDataIntegrityBindingProof && !didCommSignedAttachmentBindingProof
|
|
231
|
-
? undefined
|
|
232
|
-
: {
|
|
233
|
-
anoncreds_link_secret: anonCredsLinkSecretDataIntegrityBindingProof,
|
|
234
|
-
didcomm_signed_attachment: didCommSignedAttachmentBindingProof,
|
|
235
|
-
};
|
|
236
|
-
if (credentialOffer.bindingRequired && !bindingProof)
|
|
237
|
-
throw new core_1.CredoError('Missing required binding proof');
|
|
238
|
-
const dataModelVersion = (_e = dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.dataModelVersion) !== null && _e !== void 0 ? _e : credentialOffer.dataModelVersionsSupported[0];
|
|
239
|
-
if (!credentialOffer.dataModelVersionsSupported.includes(dataModelVersion)) {
|
|
240
|
-
throw new core_1.CredoError('Cannot request credential with a data model version that was not offered.');
|
|
241
|
-
}
|
|
242
|
-
const credentialRequest = {
|
|
243
|
-
data_model_version: dataModelVersion,
|
|
244
|
-
binding_proof: bindingProof,
|
|
245
|
-
};
|
|
246
|
-
const format = new core_1.CredentialFormatSpec({
|
|
247
|
-
attachmentId,
|
|
248
|
-
format: W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST,
|
|
249
|
-
});
|
|
250
|
-
const attachment = this.getFormatData(credentialRequest, format.attachmentId);
|
|
251
|
-
return { format, attachment, appendAttachments: didCommSignedAttachment ? [didCommSignedAttachment] : undefined };
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Starting from a request is not supported for anoncreds credentials, this method only throws an error.
|
|
255
|
-
*/
|
|
256
|
-
async createRequest() {
|
|
257
|
-
throw new core_1.CredoError('Starting from a request is not supported for w3c credentials');
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* We don't have any models to validate an anoncreds request object, for now this method does nothing
|
|
261
|
-
*/
|
|
262
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
263
|
-
async processRequest(agentContext, options) {
|
|
264
|
-
// not needed for dataIntegrity
|
|
265
|
-
}
|
|
266
|
-
async createCredentialWithAnonCredsDataIntegrityProof(agentContext, input) {
|
|
267
|
-
const { credentialRecord, anonCredsLinkSecretBindingMethod, anonCredsLinkSecretBindingProof, linkSecretMetadata, credentialSubjectId, } = input;
|
|
268
|
-
const credentialAttributes = credentialRecord.credentialAttributes;
|
|
269
|
-
if (!credentialAttributes) {
|
|
270
|
-
throw new core_1.CredoError(`Missing required credential attribute values on credential record with id ${credentialRecord.id}`);
|
|
271
|
-
}
|
|
272
|
-
const credentialSubjectIdAttribute = credentialAttributes.find((ca) => ca.name === 'id');
|
|
273
|
-
if (credentialSubjectId &&
|
|
274
|
-
credentialSubjectIdAttribute &&
|
|
275
|
-
credentialSubjectIdAttribute.value !== credentialSubjectId) {
|
|
276
|
-
throw new core_1.CredoError('Invalid credential subject id.');
|
|
277
|
-
}
|
|
278
|
-
else if (!credentialSubjectIdAttribute && credentialSubjectId) {
|
|
279
|
-
credentialAttributes.push(new core_1.CredentialPreviewAttribute({ name: 'id', value: credentialSubjectId }));
|
|
280
|
-
}
|
|
281
|
-
const anonCredsIssuerService = agentContext.dependencyManager.resolve(services_1.AnonCredsIssuerServiceSymbol);
|
|
282
|
-
const credentialDefinition = (await agentContext.dependencyManager
|
|
283
|
-
.resolve(repository_1.AnonCredsCredentialDefinitionRepository)
|
|
284
|
-
.getByCredentialDefinitionId(agentContext, linkSecretMetadata.credentialDefinitionId)).credentialDefinition.value;
|
|
285
|
-
// We check locally for credential definition info. If it supports revocation, we need to search locally for
|
|
286
|
-
// an active revocation registry
|
|
287
|
-
let revocationRegistryDefinitionId = undefined;
|
|
288
|
-
let revocationRegistryIndex = undefined;
|
|
289
|
-
let revocationStatusList = undefined;
|
|
290
|
-
if (credentialDefinition.revocation) {
|
|
291
|
-
const { credentialRevocationId, revocationRegistryId } = linkSecretMetadata;
|
|
292
|
-
if (!credentialRevocationId || !revocationRegistryId) {
|
|
293
|
-
throw new core_1.CredoError('Revocation registry definition id and revocation index are mandatory to issue AnonCreds revocable credentials');
|
|
294
|
-
}
|
|
295
|
-
revocationRegistryDefinitionId = revocationRegistryId;
|
|
296
|
-
revocationRegistryIndex = Number(credentialRevocationId);
|
|
297
|
-
const revocationRegistryDefinitionPrivateRecord = await agentContext.dependencyManager
|
|
298
|
-
.resolve(repository_1.AnonCredsRevocationRegistryDefinitionPrivateRepository)
|
|
299
|
-
.getByRevocationRegistryDefinitionId(agentContext, revocationRegistryDefinitionId);
|
|
300
|
-
if (revocationRegistryDefinitionPrivateRecord.state !== repository_1.AnonCredsRevocationRegistryState.Active) {
|
|
301
|
-
throw new core_1.CredoError(`Revocation registry ${revocationRegistryDefinitionId} is in ${revocationRegistryDefinitionPrivateRecord.state} state`);
|
|
302
|
-
}
|
|
303
|
-
const revocationStatusListResult = await (0, utils_1.fetchRevocationStatusList)(agentContext, revocationRegistryDefinitionId, (0, utils_1.dateToTimestamp)(new Date()));
|
|
304
|
-
revocationStatusList = revocationStatusListResult.revocationStatusList;
|
|
305
|
-
}
|
|
306
|
-
const { credential } = await anonCredsIssuerService.createCredential(agentContext, {
|
|
307
|
-
credentialOffer: {
|
|
308
|
-
schema_id: linkSecretMetadata.schemaId,
|
|
309
|
-
cred_def_id: anonCredsLinkSecretBindingMethod.credentialDefinitionId,
|
|
310
|
-
key_correctness_proof: anonCredsLinkSecretBindingMethod.keyCorrectnessProof,
|
|
311
|
-
nonce: anonCredsLinkSecretBindingMethod.nonce,
|
|
312
|
-
},
|
|
313
|
-
credentialRequest: anonCredsLinkSecretBindingProof,
|
|
314
|
-
credentialValues: (0, credential_1.convertAttributesToCredentialValues)(credentialAttributes),
|
|
315
|
-
revocationRegistryDefinitionId,
|
|
316
|
-
revocationRegistryIndex,
|
|
317
|
-
revocationStatusList,
|
|
318
|
-
});
|
|
319
|
-
const { credentialDefinition: anoncredsCredentialDefinition } = await (0, utils_1.fetchCredentialDefinition)(agentContext, credential.cred_def_id);
|
|
320
|
-
const anonCredsHolderService = agentContext.dependencyManager.resolve(services_1.AnonCredsHolderServiceSymbol);
|
|
321
|
-
return await anonCredsHolderService.legacyToW3cCredential(agentContext, {
|
|
322
|
-
credential,
|
|
323
|
-
issuerId: anoncredsCredentialDefinition.issuerId,
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
async getSignatureMetadata(agentContext, offeredCredential, issuerVerificationMethod) {
|
|
327
|
-
var _a, _b;
|
|
328
|
-
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
329
|
-
const didDocument = await didsApi.resolveDidDocument(offeredCredential.issuerId);
|
|
330
|
-
let verificationMethod;
|
|
331
|
-
if (issuerVerificationMethod) {
|
|
332
|
-
verificationMethod = didDocument.dereferenceKey(issuerVerificationMethod, ['authentication', 'assertionMethod']);
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
const vms = (_b = (_a = didDocument.authentication) !== null && _a !== void 0 ? _a : didDocument.assertionMethod) !== null && _b !== void 0 ? _b : didDocument.verificationMethod;
|
|
336
|
-
if (!vms || vms.length === 0) {
|
|
337
|
-
throw new core_1.CredoError('Missing authenticationMethod, assertionMethod, and verificationMethods in did document');
|
|
338
|
-
}
|
|
339
|
-
if (typeof vms[0] === 'string') {
|
|
340
|
-
verificationMethod = didDocument.dereferenceVerificationMethod(vms[0]);
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
verificationMethod = vms[0];
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
const signatureSuiteRegistry = agentContext.dependencyManager.resolve(core_1.SignatureSuiteRegistry);
|
|
347
|
-
const signatureSuite = signatureSuiteRegistry.getByVerificationMethodType(verificationMethod.type);
|
|
348
|
-
if (!signatureSuite) {
|
|
349
|
-
throw new core_1.CredoError(`Could not find signature suite for verification method type ${verificationMethod.type}`);
|
|
350
|
-
}
|
|
351
|
-
return { verificationMethod, signatureSuite, offeredCredential };
|
|
352
|
-
}
|
|
353
|
-
async assertAndSetCredentialSubjectId(credential, credentialSubjectId) {
|
|
354
|
-
if (!credentialSubjectId)
|
|
355
|
-
return credential;
|
|
356
|
-
if (Array.isArray(credential.credentialSubject)) {
|
|
357
|
-
throw new core_1.CredoError('Invalid credential subject relation. Cannot determine the subject to be updated.');
|
|
358
|
-
}
|
|
359
|
-
const subjectId = credential.credentialSubject.id;
|
|
360
|
-
if (subjectId && credentialSubjectId !== subjectId) {
|
|
361
|
-
throw new core_1.CredoError('Invalid credential subject id.');
|
|
362
|
-
}
|
|
363
|
-
if (!subjectId)
|
|
364
|
-
credential.credentialSubject.id = credentialSubjectId;
|
|
365
|
-
return credential;
|
|
366
|
-
}
|
|
367
|
-
async signCredential(agentContext, credential, issuerVerificationMethod) {
|
|
368
|
-
const { signatureSuite, verificationMethod } = await this.getSignatureMetadata(agentContext, credential, issuerVerificationMethod);
|
|
369
|
-
const w3cCredentialService = agentContext.dependencyManager.resolve(core_1.W3cCredentialService);
|
|
370
|
-
let credentialToBeSigned = credential;
|
|
371
|
-
if (credential instanceof core_1.W3cJsonLdVerifiableCredential) {
|
|
372
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
373
|
-
const { proof } = credential, _credentialToBeSigned = __rest(credential, ["proof"]);
|
|
374
|
-
credentialToBeSigned = _credentialToBeSigned;
|
|
375
|
-
}
|
|
376
|
-
const w3cJsonLdVerifiableCredential = (await w3cCredentialService.signCredential(agentContext, {
|
|
377
|
-
format: core_1.ClaimFormat.LdpVc,
|
|
378
|
-
credential: credentialToBeSigned,
|
|
379
|
-
proofType: signatureSuite.proofType,
|
|
380
|
-
verificationMethod: verificationMethod.id,
|
|
381
|
-
}));
|
|
382
|
-
if (Array.isArray(w3cJsonLdVerifiableCredential.proof)) {
|
|
383
|
-
throw new core_1.CredoError('A newly signed credential can not have multiple proofs');
|
|
384
|
-
}
|
|
385
|
-
if (credential instanceof core_1.W3cJsonLdVerifiableCredential) {
|
|
386
|
-
const combinedProofs = Array.isArray(credential.proof) ? credential.proof : [credential.proof];
|
|
387
|
-
combinedProofs.push(w3cJsonLdVerifiableCredential.proof);
|
|
388
|
-
w3cJsonLdVerifiableCredential.proof = combinedProofs;
|
|
389
|
-
}
|
|
390
|
-
return w3cJsonLdVerifiableCredential;
|
|
391
|
-
}
|
|
392
|
-
async acceptRequest(agentContext, { credentialFormats, credentialRecord, attachmentId, offerAttachment, requestAttachment, requestAppendAttachments, }) {
|
|
393
|
-
var _a, _b, _c, _d, _e, _f;
|
|
394
|
-
const dataIntegrityFormat = credentialFormats === null || credentialFormats === void 0 ? void 0 : credentialFormats.dataIntegrity;
|
|
395
|
-
const credentialOffer = core_1.JsonTransformer.fromJSON(offerAttachment === null || offerAttachment === void 0 ? void 0 : offerAttachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
396
|
-
const assertedCredential = await this.assertAndSetCredentialSubjectId(core_1.JsonTransformer.fromJSON(credentialOffer.credential, core_1.W3cCredential), dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.credentialSubjectId);
|
|
397
|
-
const credentialRequest = requestAttachment.getDataAsJson();
|
|
398
|
-
if (!credentialRequest)
|
|
399
|
-
throw new core_1.CredoError('Missing data integrity credential request in createCredential');
|
|
400
|
-
let signedCredential;
|
|
401
|
-
if ((_a = credentialRequest.binding_proof) === null || _a === void 0 ? void 0 : _a.anoncreds_link_secret) {
|
|
402
|
-
if (!((_b = credentialOffer.bindingMethod) === null || _b === void 0 ? void 0 : _b.anoncredsLinkSecret)) {
|
|
403
|
-
throw new core_1.CredoError('Cannot issue credential with a binding method that was not offered');
|
|
404
|
-
}
|
|
405
|
-
const linkSecretMetadata = credentialRecord.metadata.get(metadata_1.AnonCredsCredentialMetadataKey);
|
|
406
|
-
if (!linkSecretMetadata)
|
|
407
|
-
throw new core_1.CredoError('Missing anoncreds link secret metadata');
|
|
408
|
-
signedCredential = await this.createCredentialWithAnonCredsDataIntegrityProof(agentContext, {
|
|
409
|
-
credentialRecord,
|
|
410
|
-
anonCredsLinkSecretBindingMethod: credentialOffer.bindingMethod.anoncredsLinkSecret,
|
|
411
|
-
linkSecretMetadata,
|
|
412
|
-
anonCredsLinkSecretBindingProof: credentialRequest.binding_proof.anoncreds_link_secret,
|
|
413
|
-
credentialSubjectId: dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.credentialSubjectId,
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
if ((_c = credentialRequest.binding_proof) === null || _c === void 0 ? void 0 : _c.didcomm_signed_attachment) {
|
|
417
|
-
if (!((_d = credentialOffer.bindingMethod) === null || _d === void 0 ? void 0 : _d.didcommSignedAttachment)) {
|
|
418
|
-
throw new core_1.CredoError('Cannot issue credential with a binding method that was not offered');
|
|
419
|
-
}
|
|
420
|
-
const bindingProofAttachment = requestAppendAttachments === null || requestAppendAttachments === void 0 ? void 0 : requestAppendAttachments.find((attachments) => { var _a, _b; return attachments.id === ((_b = (_a = credentialRequest.binding_proof) === null || _a === void 0 ? void 0 : _a.didcomm_signed_attachment) === null || _b === void 0 ? void 0 : _b.attachment_id); });
|
|
421
|
-
if (!bindingProofAttachment)
|
|
422
|
-
throw new core_1.CredoError('Missing binding proof attachment');
|
|
423
|
-
const { nonce } = await this.getSignedAttachmentPayload(agentContext, bindingProofAttachment);
|
|
424
|
-
if (nonce !== credentialOffer.bindingMethod.didcommSignedAttachment.nonce) {
|
|
425
|
-
throw new core_1.CredoError('Invalid nonce in signed attachment');
|
|
426
|
-
}
|
|
427
|
-
signedCredential = await this.signCredential(agentContext, signedCredential !== null && signedCredential !== void 0 ? signedCredential : assertedCredential, dataIntegrityFormat === null || dataIntegrityFormat === void 0 ? void 0 : dataIntegrityFormat.issuerVerificationMethod);
|
|
428
|
-
}
|
|
429
|
-
if (!((_e = credentialRequest.binding_proof) === null || _e === void 0 ? void 0 : _e.anoncreds_link_secret) &&
|
|
430
|
-
!((_f = credentialRequest.binding_proof) === null || _f === void 0 ? void 0 : _f.didcomm_signed_attachment)) {
|
|
431
|
-
signedCredential = await this.signCredential(agentContext, assertedCredential);
|
|
432
|
-
}
|
|
433
|
-
const format = new core_1.CredentialFormatSpec({
|
|
434
|
-
attachmentId,
|
|
435
|
-
format: W3C_DATA_INTEGRITY_CREDENTIAL,
|
|
436
|
-
});
|
|
437
|
-
const attachment = this.getFormatData({ credential: core_1.JsonTransformer.toJSON(signedCredential) }, format.attachmentId);
|
|
438
|
-
return { format, attachment };
|
|
439
|
-
}
|
|
440
|
-
async storeAnonCredsCredential(agentContext, credentialJson, credentialRecord, linkSecretRequestMetadata) {
|
|
441
|
-
var _a;
|
|
442
|
-
if (!credentialRecord.credentialAttributes) {
|
|
443
|
-
throw new core_1.CredoError('Missing credential attributes on credential record. Unable to check credential attributes');
|
|
444
|
-
}
|
|
445
|
-
const anonCredsHolderService = agentContext.dependencyManager.resolve(services_1.AnonCredsHolderServiceSymbol);
|
|
446
|
-
const legacyAnonCredsCredential = await anonCredsHolderService.w3cToLegacyCredential(agentContext, {
|
|
447
|
-
credential: core_1.JsonTransformer.fromJSON(credentialJson, core_1.W3cJsonLdVerifiableCredential),
|
|
448
|
-
});
|
|
449
|
-
const { schema_id: schemaId, cred_def_id: credentialDefinitionId, rev_reg_id: revocationRegistryId, } = legacyAnonCredsCredential;
|
|
450
|
-
const schemaReturn = await (0, utils_1.fetchSchema)(agentContext, schemaId);
|
|
451
|
-
const credentialDefinitionReturn = await (0, utils_1.fetchCredentialDefinition)(agentContext, credentialDefinitionId);
|
|
452
|
-
const revocationRegistryDefinitionReturn = revocationRegistryId
|
|
453
|
-
? await (0, utils_1.fetchRevocationRegistryDefinition)(agentContext, revocationRegistryId)
|
|
454
|
-
: undefined;
|
|
455
|
-
// This is required to process the credential
|
|
456
|
-
const w3cJsonLdVerifiableCredential = await anonCredsHolderService.legacyToW3cCredential(agentContext, {
|
|
457
|
-
credential: legacyAnonCredsCredential,
|
|
458
|
-
issuerId: credentialJson.issuer,
|
|
459
|
-
processOptions: {
|
|
460
|
-
credentialRequestMetadata: linkSecretRequestMetadata,
|
|
461
|
-
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
462
|
-
revocationRegistryDefinition: revocationRegistryDefinitionReturn === null || revocationRegistryDefinitionReturn === void 0 ? void 0 : revocationRegistryDefinitionReturn.revocationRegistryDefinition,
|
|
463
|
-
},
|
|
464
|
-
});
|
|
465
|
-
const w3cCredentialRecordId = await anonCredsHolderService.storeCredential(agentContext, {
|
|
466
|
-
credential: w3cJsonLdVerifiableCredential,
|
|
467
|
-
schema: schemaReturn.schema,
|
|
468
|
-
credentialDefinitionId,
|
|
469
|
-
credentialDefinition: credentialDefinitionReturn.credentialDefinition,
|
|
470
|
-
credentialRequestMetadata: linkSecretRequestMetadata,
|
|
471
|
-
revocationRegistry: revocationRegistryDefinitionReturn
|
|
472
|
-
? {
|
|
473
|
-
id: revocationRegistryId,
|
|
474
|
-
definition: revocationRegistryDefinitionReturn === null || revocationRegistryDefinitionReturn === void 0 ? void 0 : revocationRegistryDefinitionReturn.revocationRegistryDefinition,
|
|
475
|
-
}
|
|
476
|
-
: undefined,
|
|
477
|
-
});
|
|
478
|
-
const w3cCredentialService = agentContext.dependencyManager.resolve(core_1.W3cCredentialService);
|
|
479
|
-
const w3cCredentialRecord = await w3cCredentialService.getCredentialRecordById(agentContext, w3cCredentialRecordId);
|
|
480
|
-
// If the credential is revocable, store the revocation identifiers in the credential record
|
|
481
|
-
if (revocationRegistryId) {
|
|
482
|
-
const linkSecretMetadata = credentialRecord.metadata.get(metadata_1.AnonCredsCredentialMetadataKey);
|
|
483
|
-
if (!linkSecretMetadata)
|
|
484
|
-
throw new core_1.CredoError('Missing link secret metadata');
|
|
485
|
-
const anonCredsTags = await (0, w3cAnonCredsUtils_1.getAnonCredsTagsFromRecord)(w3cCredentialRecord);
|
|
486
|
-
if (!anonCredsTags)
|
|
487
|
-
throw new core_1.CredoError('Missing anoncreds tags on credential record.');
|
|
488
|
-
linkSecretMetadata.revocationRegistryId = revocationRegistryDefinitionReturn === null || revocationRegistryDefinitionReturn === void 0 ? void 0 : revocationRegistryDefinitionReturn.revocationRegistryDefinitionId;
|
|
489
|
-
linkSecretMetadata.credentialRevocationId = (_a = anonCredsTags.anonCredsCredentialRevocationId) === null || _a === void 0 ? void 0 : _a.toString();
|
|
490
|
-
credentialRecord.metadata.set(metadata_1.AnonCredsCredentialMetadataKey, linkSecretMetadata);
|
|
491
|
-
}
|
|
492
|
-
return w3cCredentialRecord;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Processes an incoming credential - retrieve metadata, retrieve payload and store it in wallet
|
|
496
|
-
* @param options the issue credential message wrapped inside this object
|
|
497
|
-
* @param credentialRecord the credential exchange record for this credential
|
|
498
|
-
*/
|
|
499
|
-
async processCredential(agentContext, { credentialRecord, attachment, requestAttachment, offerAttachment }) {
|
|
500
|
-
var _a, _b, _c;
|
|
501
|
-
const credentialOffer = core_1.JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
502
|
-
const offeredCredentialJson = credentialOffer.credential;
|
|
503
|
-
const credentialRequest = requestAttachment.getDataAsJson();
|
|
504
|
-
if (!credentialRequest)
|
|
505
|
-
throw new core_1.CredoError('Missing data integrity credential request in createCredential');
|
|
506
|
-
if (!credentialRecord.credentialAttributes) {
|
|
507
|
-
throw new core_1.CredoError('Missing credential attributes on credential record.');
|
|
508
|
-
}
|
|
509
|
-
const { credential: credentialJson } = attachment.getDataAsJson();
|
|
510
|
-
if (Array.isArray(offeredCredentialJson.credentialSubject)) {
|
|
511
|
-
throw new core_1.CredoError('Invalid credential subject. Multiple credential subjects are not yet supported.');
|
|
512
|
-
}
|
|
513
|
-
const credentialSubjectMatches = Object.entries(offeredCredentialJson.credentialSubject).every(([key, offeredValue]) => {
|
|
514
|
-
const receivedValue = credentialJson.credentialSubject[key];
|
|
515
|
-
if (!offeredValue || !receivedValue)
|
|
516
|
-
return false;
|
|
517
|
-
if (typeof offeredValue === 'number' || typeof receivedValue === 'number') {
|
|
518
|
-
return offeredValue.toString() === receivedValue.toString();
|
|
519
|
-
}
|
|
520
|
-
return (0, core_1.deepEquality)(offeredValue, receivedValue);
|
|
521
|
-
});
|
|
522
|
-
if (!credentialSubjectMatches) {
|
|
523
|
-
throw new core_1.CredoError('Received invalid credential. Received credential subject does not match the offered credential subject.');
|
|
524
|
-
}
|
|
525
|
-
const credentialVersion = this.getCredentialVersion(credentialJson);
|
|
526
|
-
const expectedReceivedCredential = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, offeredCredentialJson), { '@context': credentialJson['@context'], issuer: (_a = offeredCredentialJson.issuer) !== null && _a !== void 0 ? _a : credentialJson.issuer, credentialSubject: credentialJson.credentialSubject }), (credentialVersion === '1.1' && { issuanceDate: credentialJson.issuanceDate })), (credentialVersion === '2.0' && { validFrom: credentialJson.validFrom })), (offeredCredentialJson.credentialStatus && { credentialStatus: credentialJson.credentialStatus })), { proof: credentialJson.proof });
|
|
527
|
-
if (!(0, core_1.deepEquality)(credentialJson, expectedReceivedCredential)) {
|
|
528
|
-
throw new core_1.CredoError('Received invalid credential. Received credential does not match the offered credential');
|
|
529
|
-
}
|
|
530
|
-
let w3cCredentialRecord;
|
|
531
|
-
if ((_b = credentialRequest.binding_proof) === null || _b === void 0 ? void 0 : _b.anoncreds_link_secret) {
|
|
532
|
-
const linkSecretRequestMetadata = credentialRecord.metadata.get(metadata_1.AnonCredsCredentialRequestMetadataKey);
|
|
533
|
-
if (!linkSecretRequestMetadata) {
|
|
534
|
-
throw new core_1.CredoError('Missing link secret request metadata');
|
|
535
|
-
}
|
|
536
|
-
const integrityProtectedFields = ['@context', 'issuer', 'type', 'credentialSubject', 'validFrom', 'issuanceDate'];
|
|
537
|
-
if (Object.keys(offeredCredentialJson).some((key) => !integrityProtectedFields.includes(key) && key !== 'proof')) {
|
|
538
|
-
throw new core_1.CredoError('Credential offer contains non anoncreds integrity protected fields.');
|
|
539
|
-
}
|
|
540
|
-
if (!Array.isArray(offeredCredentialJson.type) || (offeredCredentialJson === null || offeredCredentialJson === void 0 ? void 0 : offeredCredentialJson.type.length) !== 1) {
|
|
541
|
-
throw new core_1.CredoError(`Invalid credential type. Only single credential type 'VerifiableCredential' is supported`);
|
|
542
|
-
}
|
|
543
|
-
w3cCredentialRecord = await this.storeAnonCredsCredential(agentContext, credentialJson, credentialRecord, linkSecretRequestMetadata);
|
|
544
|
-
await this.assertCredentialAttributesMatchSchemaAttributes(agentContext, w3cCredentialRecord.credential, (_c = (0, w3cAnonCredsUtils_1.getAnonCredsTagsFromRecord)(w3cCredentialRecord)) === null || _c === void 0 ? void 0 : _c.anonCredsSchemaId, true);
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
const w3cCredentialService = agentContext.dependencyManager.resolve(core_1.W3cCredentialService);
|
|
548
|
-
const w3cJsonLdVerifiableCredential = core_1.JsonTransformer.fromJSON(credentialJson, core_1.W3cJsonLdVerifiableCredential);
|
|
549
|
-
w3cCredentialRecord = await w3cCredentialService.storeCredential(agentContext, {
|
|
550
|
-
credential: w3cJsonLdVerifiableCredential,
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
credentialRecord.credentials.push({
|
|
554
|
-
credentialRecordType: this.credentialRecordType,
|
|
555
|
-
credentialRecordId: w3cCredentialRecord.id,
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
supportsFormat(format) {
|
|
559
|
-
const supportedFormats = [
|
|
560
|
-
W3C_DATA_INTEGRITY_CREDENTIAL_REQUEST,
|
|
561
|
-
W3C_DATA_INTEGRITY_CREDENTIAL_OFFER,
|
|
562
|
-
W3C_DATA_INTEGRITY_CREDENTIAL,
|
|
563
|
-
];
|
|
564
|
-
return supportedFormats.includes(format);
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Gets the attachment object for a given attachmentId. We need to get out the correct attachmentId for
|
|
568
|
-
* anoncreds and then find the corresponding attachment (if there is one)
|
|
569
|
-
* @param formats the formats object containing the attachmentId
|
|
570
|
-
* @param messageAttachments the attachments containing the payload
|
|
571
|
-
* @returns The Attachment if found or undefined
|
|
572
|
-
*
|
|
573
|
-
*/
|
|
574
|
-
getAttachment(formats, messageAttachments) {
|
|
575
|
-
const supportedAttachmentIds = formats.filter((f) => this.supportsFormat(f.format)).map((f) => f.attachmentId);
|
|
576
|
-
const supportedAttachment = messageAttachments.find((attachment) => supportedAttachmentIds.includes(attachment.id));
|
|
577
|
-
return supportedAttachment;
|
|
578
|
-
}
|
|
579
|
-
async deleteCredentialById(agentContext, credentialRecordId) {
|
|
580
|
-
const anonCredsHolderService = agentContext.dependencyManager.resolve(services_1.AnonCredsHolderServiceSymbol);
|
|
581
|
-
await anonCredsHolderService.deleteCredential(agentContext, credentialRecordId);
|
|
582
|
-
}
|
|
583
|
-
async shouldAutoRespondToProposal(
|
|
584
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
585
|
-
agentContext,
|
|
586
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
587
|
-
{ offerAttachment, proposalAttachment }) {
|
|
588
|
-
throw new core_1.CredoError('Not implemented');
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
async shouldAutoRespondToOffer(
|
|
592
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
593
|
-
agentContext,
|
|
594
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
595
|
-
{ offerAttachment }) {
|
|
596
|
-
const credentialOffer = core_1.JsonTransformer.fromJSON(offerAttachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
597
|
-
if (!credentialOffer.bindingRequired)
|
|
598
|
-
return true;
|
|
599
|
-
return false;
|
|
600
|
-
}
|
|
601
|
-
async shouldAutoRespondToRequest(
|
|
602
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
603
|
-
agentContext, { offerAttachment, requestAttachment }) {
|
|
604
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
605
|
-
const credentialOffer = core_1.JsonTransformer.fromJSON(offerAttachment === null || offerAttachment === void 0 ? void 0 : offerAttachment.getDataAsJson(), core_1.DataIntegrityCredentialOffer);
|
|
606
|
-
const credentialRequest = requestAttachment.getDataAsJson();
|
|
607
|
-
if (!credentialOffer.bindingRequired &&
|
|
608
|
-
!((_a = credentialRequest.binding_proof) === null || _a === void 0 ? void 0 : _a.anoncreds_link_secret) &&
|
|
609
|
-
!((_b = credentialRequest.binding_proof) === null || _b === void 0 ? void 0 : _b.didcomm_signed_attachment)) {
|
|
610
|
-
return true;
|
|
611
|
-
}
|
|
612
|
-
if (credentialOffer.bindingRequired &&
|
|
613
|
-
!((_c = credentialRequest.binding_proof) === null || _c === void 0 ? void 0 : _c.anoncreds_link_secret) &&
|
|
614
|
-
!((_d = credentialRequest.binding_proof) === null || _d === void 0 ? void 0 : _d.didcomm_signed_attachment)) {
|
|
615
|
-
return false;
|
|
616
|
-
}
|
|
617
|
-
// cannot auto response credential subject id must be set manually
|
|
618
|
-
if ((_e = credentialRequest.binding_proof) === null || _e === void 0 ? void 0 : _e.didcomm_signed_attachment) {
|
|
619
|
-
try {
|
|
620
|
-
const subjectJson = credentialOffer.credential.credentialSubject;
|
|
621
|
-
const credentialSubject = core_1.JsonTransformer.fromJSON(subjectJson, core_1.W3cCredentialSubject);
|
|
622
|
-
if (credentialSubject.id === undefined)
|
|
623
|
-
return false;
|
|
624
|
-
}
|
|
625
|
-
catch (e) {
|
|
626
|
-
return false;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
const validLinkSecretRequest = !((_f = credentialRequest.binding_proof) === null || _f === void 0 ? void 0 : _f.anoncreds_link_secret) ||
|
|
630
|
-
(((_g = credentialRequest.binding_proof) === null || _g === void 0 ? void 0 : _g.anoncreds_link_secret) && ((_h = credentialOffer.bindingMethod) === null || _h === void 0 ? void 0 : _h.anoncredsLinkSecret));
|
|
631
|
-
const validDidCommSignedAttachmetRequest = !((_j = credentialRequest.binding_proof) === null || _j === void 0 ? void 0 : _j.didcomm_signed_attachment) ||
|
|
632
|
-
(((_k = credentialRequest.binding_proof) === null || _k === void 0 ? void 0 : _k.didcomm_signed_attachment) &&
|
|
633
|
-
((_l = credentialOffer.bindingMethod) === null || _l === void 0 ? void 0 : _l.didcommSignedAttachment));
|
|
634
|
-
return Boolean(validLinkSecretRequest && validDidCommSignedAttachmetRequest);
|
|
635
|
-
}
|
|
636
|
-
async shouldAutoRespondToCredential(
|
|
637
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
638
|
-
agentContext,
|
|
639
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
640
|
-
{ credentialRecord, requestAttachment, credentialAttachment }) {
|
|
641
|
-
return true;
|
|
642
|
-
}
|
|
643
|
-
async createDataIntegrityCredentialOffer(agentContext, credentialRecord, options) {
|
|
644
|
-
const { bindingRequired, credential, anonCredsLinkSecretBinding: anonCredsLinkSecretBindingMethodOptions, didCommSignedAttachmentBinding: didCommSignedAttachmentBindingMethodOptions, } = options;
|
|
645
|
-
const dataModelVersionsSupported = ['1.1'];
|
|
646
|
-
// validate the credential and get the preview attributes
|
|
647
|
-
const credentialJson = credential instanceof core_1.W3cCredential ? core_1.JsonTransformer.toJSON(credential) : credential;
|
|
648
|
-
const validW3cCredential = core_1.JsonTransformer.fromJSON(credentialJson, core_1.W3cCredential);
|
|
649
|
-
const previewAttributes = this.previewAttributesFromCredential(validW3cCredential);
|
|
650
|
-
let anonCredsLinkSecretBindingMethod = undefined;
|
|
651
|
-
if (anonCredsLinkSecretBindingMethodOptions) {
|
|
652
|
-
const { credentialDefinitionId, revocationRegistryDefinitionId, revocationRegistryIndex } = anonCredsLinkSecretBindingMethodOptions;
|
|
653
|
-
const anoncredsCredentialOffer = await agentContext.dependencyManager
|
|
654
|
-
.resolve(services_1.AnonCredsIssuerServiceSymbol)
|
|
655
|
-
.createCredentialOffer(agentContext, { credentialDefinitionId });
|
|
656
|
-
// We check locally for credential definition info. If it supports revocation, revocationRegistryIndex
|
|
657
|
-
// and revocationRegistryDefinitionId are mandatory
|
|
658
|
-
const { credentialDefinition } = await agentContext.dependencyManager
|
|
659
|
-
.resolve(repository_1.AnonCredsCredentialDefinitionRepository)
|
|
660
|
-
.getByCredentialDefinitionId(agentContext, anoncredsCredentialOffer.cred_def_id);
|
|
661
|
-
if (credentialDefinition.value.revocation) {
|
|
662
|
-
if (!revocationRegistryDefinitionId || !revocationRegistryIndex) {
|
|
663
|
-
throw new core_1.CredoError('AnonCreds revocable credentials require revocationRegistryDefinitionId and revocationRegistryIndex');
|
|
664
|
-
}
|
|
665
|
-
// Set revocation tags
|
|
666
|
-
credentialRecord.setTags({
|
|
667
|
-
anonCredsRevocationRegistryId: revocationRegistryDefinitionId,
|
|
668
|
-
anonCredsCredentialRevocationId: revocationRegistryIndex.toString(),
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
await this.assertCredentialAttributesMatchSchemaAttributes(agentContext, validW3cCredential, credentialDefinition.schemaId, false);
|
|
672
|
-
anonCredsLinkSecretBindingMethod = {
|
|
673
|
-
credentialDefinitionId: anoncredsCredentialOffer.cred_def_id,
|
|
674
|
-
keyCorrectnessProof: anoncredsCredentialOffer.key_correctness_proof,
|
|
675
|
-
nonce: anoncredsCredentialOffer.nonce,
|
|
676
|
-
};
|
|
677
|
-
credentialRecord.metadata.set(metadata_1.AnonCredsCredentialMetadataKey, {
|
|
678
|
-
schemaId: anoncredsCredentialOffer.schema_id,
|
|
679
|
-
credentialDefinitionId: credentialDefinitionId,
|
|
680
|
-
credentialRevocationId: revocationRegistryIndex === null || revocationRegistryIndex === void 0 ? void 0 : revocationRegistryIndex.toString(),
|
|
681
|
-
revocationRegistryId: revocationRegistryDefinitionId,
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
let didCommSignedAttachmentBindingMethod = undefined;
|
|
685
|
-
if (didCommSignedAttachmentBindingMethodOptions) {
|
|
686
|
-
const { didMethodsSupported, algsSupported } = didCommSignedAttachmentBindingMethodOptions;
|
|
687
|
-
didCommSignedAttachmentBindingMethod = {
|
|
688
|
-
didMethodsSupported: didMethodsSupported !== null && didMethodsSupported !== void 0 ? didMethodsSupported : agentContext.dependencyManager.resolve(core_1.DidsApi).supportedResolverMethods,
|
|
689
|
-
algsSupported: algsSupported !== null && algsSupported !== void 0 ? algsSupported : this.getSupportedJwaSignatureAlgorithms(agentContext),
|
|
690
|
-
nonce: await agentContext.wallet.generateNonce(),
|
|
691
|
-
};
|
|
692
|
-
if (didCommSignedAttachmentBindingMethod.algsSupported.length === 0) {
|
|
693
|
-
throw new core_1.CredoError('No supported JWA signature algorithms found.');
|
|
694
|
-
}
|
|
695
|
-
if (didCommSignedAttachmentBindingMethod.didMethodsSupported.length === 0) {
|
|
696
|
-
throw new core_1.CredoError('No supported DID methods found.');
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
if (bindingRequired && !anonCredsLinkSecretBindingMethod && !didCommSignedAttachmentBindingMethod) {
|
|
700
|
-
throw new core_1.CredoError('Missing required binding method.');
|
|
701
|
-
}
|
|
702
|
-
const dataIntegrityCredentialOffer = new core_1.DataIntegrityCredentialOffer({
|
|
703
|
-
dataModelVersionsSupported,
|
|
704
|
-
bindingRequired: bindingRequired,
|
|
705
|
-
bindingMethod: {
|
|
706
|
-
anoncredsLinkSecret: anonCredsLinkSecretBindingMethod,
|
|
707
|
-
didcommSignedAttachment: didCommSignedAttachmentBindingMethod,
|
|
708
|
-
},
|
|
709
|
-
credential: credentialJson,
|
|
710
|
-
});
|
|
711
|
-
return { dataIntegrityCredentialOffer, previewAttributes };
|
|
712
|
-
}
|
|
713
|
-
previewAttributesFromCredential(credential) {
|
|
714
|
-
if (Array.isArray(credential.credentialSubject)) {
|
|
715
|
-
throw new core_1.CredoError('Credential subject must be an object.');
|
|
716
|
-
}
|
|
717
|
-
const claims = Object.assign(Object.assign({}, credential.credentialSubject.claims), (credential.credentialSubject.id && { id: credential.credentialSubject.id }));
|
|
718
|
-
const attributes = Object.entries(claims).map(([key, value]) => {
|
|
719
|
-
return { name: key, value: value.toString() };
|
|
720
|
-
});
|
|
721
|
-
return attributes;
|
|
722
|
-
}
|
|
723
|
-
async assertCredentialAttributesMatchSchemaAttributes(agentContext, credential, schemaId, credentialSubjectIdMustBeSet) {
|
|
724
|
-
const attributes = this.previewAttributesFromCredential(credential);
|
|
725
|
-
const schemaReturn = await (0, utils_1.fetchSchema)(agentContext, schemaId);
|
|
726
|
-
const enhancedAttributes = [...attributes];
|
|
727
|
-
if (!credentialSubjectIdMustBeSet &&
|
|
728
|
-
schemaReturn.schema.attrNames.includes('id') &&
|
|
729
|
-
attributes.find((attr) => attr.name === 'id') === undefined)
|
|
730
|
-
enhancedAttributes.push({ name: 'id', value: 'mock' });
|
|
731
|
-
(0, credential_1.assertAttributesMatch)(schemaReturn.schema, enhancedAttributes);
|
|
732
|
-
return { attributes };
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Returns an object of type {@link Attachment} for use in credential exchange messages.
|
|
736
|
-
* It looks up the correct format identifier and encodes the data as a base64 attachment.
|
|
737
|
-
*
|
|
738
|
-
* @param data The data to include in the attach object
|
|
739
|
-
* @param id the attach id from the formats component of the message
|
|
740
|
-
*/
|
|
741
|
-
getFormatData(data, id) {
|
|
742
|
-
const attachment = new core_1.Attachment({
|
|
743
|
-
id,
|
|
744
|
-
mimeType: 'application/json',
|
|
745
|
-
data: {
|
|
746
|
-
base64: core_1.JsonEncoder.toBase64(data),
|
|
747
|
-
},
|
|
748
|
-
});
|
|
749
|
-
return attachment;
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Returns the JWA Signature Algorithms that are supported by the wallet.
|
|
753
|
-
*
|
|
754
|
-
* This is an approximation based on the supported key types of the wallet.
|
|
755
|
-
* This is not 100% correct as a supporting a key type does not mean you support
|
|
756
|
-
* all the algorithms for that key type. However, this needs refactoring of the wallet
|
|
757
|
-
* that is planned for the 0.5.0 release.
|
|
758
|
-
*/
|
|
759
|
-
getSupportedJwaSignatureAlgorithms(agentContext) {
|
|
760
|
-
const supportedKeyTypes = agentContext.wallet.supportedKeyTypes;
|
|
761
|
-
// Extract the supported JWS algs based on the key types the wallet support.
|
|
762
|
-
const supportedJwaSignatureAlgorithms = supportedKeyTypes
|
|
763
|
-
// Map the supported key types to the supported JWK class
|
|
764
|
-
.map(core_1.getJwkClassFromKeyType)
|
|
765
|
-
// Filter out the undefined values
|
|
766
|
-
.filter((jwkClass) => jwkClass !== undefined)
|
|
767
|
-
// Extract the supported JWA signature algorithms from the JWK class
|
|
768
|
-
.flatMap((jwkClass) => jwkClass.supportedSignatureAlgorithms);
|
|
769
|
-
return supportedJwaSignatureAlgorithms;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
exports.DataIntegrityCredentialFormatService = DataIntegrityCredentialFormatService;
|
|
773
|
-
//# sourceMappingURL=DataIntegrityCredentialFormatService.js.map
|