@verana-labs/vs-agent-sdk 2.0.0-dev.50 → 2.0.0-dev.52
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/agent/VsAgent.d.ts +2 -2
- package/build/blockchain/AnonCredsTrustService.d.ts +5 -0
- package/build/blockchain/AnonCredsTrustService.js +16 -3
- package/build/blockchain/AnonCredsTrustService.js.map +1 -1
- package/build/blockchain/AuthorizationService.d.ts +5 -1
- package/build/blockchain/AuthorizationService.js +17 -11
- package/build/blockchain/AuthorizationService.js.map +1 -1
- package/build/blockchain/VeranaChainService.d.ts +1 -15
- package/build/blockchain/VeranaChainService.js +1 -143
- package/build/blockchain/VeranaChainService.js.map +1 -1
- package/build/blockchain/VeranaIndexerService.d.ts +8 -1
- package/build/blockchain/VeranaIndexerService.js +102 -0
- package/build/blockchain/VeranaIndexerService.js.map +1 -1
- package/build/blockchain/handlers/authorizationHandlers.js +2 -2
- package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
- package/build/blockchain/handlers/stateMutations.js +10 -10
- package/build/blockchain/handlers/stateMutations.js.map +1 -1
- package/build/blockchain/index.d.ts +1 -0
- package/build/blockchain/index.js +1 -0
- package/build/blockchain/index.js.map +1 -1
- package/build/blockchain/indexerMappers.d.ts +3 -0
- package/build/blockchain/indexerMappers.js +53 -0
- package/build/blockchain/indexerMappers.js.map +1 -0
- package/build/blockchain/types.d.ts +0 -70
- package/build/bootstrap/EcsBootstrapService.js +7 -3
- package/build/bootstrap/EcsBootstrapService.js.map +1 -1
- package/build/did/CachedDocumentLoader.d.ts +3 -0
- package/build/did/CachedDocumentLoader.js +7 -1
- package/build/did/CachedDocumentLoader.js.map +1 -1
- package/build/plugins/setupBaseDidComm.js +1 -1
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/selfIssuedEcsCredential.d.ts +5 -1
- package/build/utils/selfIssuedEcsCredential.js +20 -14
- package/build/utils/selfIssuedEcsCredential.js.map +1 -1
- package/build/utils/setupSelfTr.d.ts +24 -9
- package/build/utils/setupSelfTr.js +37 -35
- package/build/utils/setupSelfTr.js.map +1 -1
- package/build/utils/trustCredentialStore.d.ts +34 -4
- package/build/utils/trustCredentialStore.js +119 -34
- package/build/utils/trustCredentialStore.js.map +1 -1
- package/build/utils/vcdm2.d.ts +34 -0
- package/build/utils/vcdm2.js +62 -0
- package/build/utils/vcdm2.js.map +1 -0
- package/build/vtFlow/VtFlowOrchestrator.d.ts +13 -6
- package/build/vtFlow/VtFlowOrchestrator.js +38 -37
- package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
- package/package.json +11 -11
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
|
|
39
|
+
exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_UNDEFINED_TERMS_V2 = exports.CREDENTIALS_EXAMPLE_V2 = exports.CREDENTIALS_V2 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
|
|
40
40
|
exports.defaultDocumentLoader = defaultDocumentLoader;
|
|
41
41
|
/* eslint-disable import/order */
|
|
42
42
|
const core_1 = require("@credo-ts/core");
|
|
@@ -48,6 +48,9 @@ exports.ED25519_2018_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@p
|
|
|
48
48
|
exports.ED25519_2020_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"Ed25519VerificationKey2020":{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"Ed25519Signature2020":{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
|
|
49
49
|
exports.SECP256K1_2019_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"EcdsaSecp256k1VerificationKey2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1VerificationKey2019","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"blockchainAccountId":{"@id":"https://w3id.org/security#blockchainAccountId"},"publicKeyJwk":{"@id":"https://w3id.org/security#publicKeyJwk","@type":"@json"},"publicKeyBase58":{"@id":"https://w3id.org/security#publicKeyBase58"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"jws":{"@id":"https://w3id.org/security#jws"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
|
|
50
50
|
exports.CREDENTIALS_V1 = JSON.parse('{"@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","credentialSchema":{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","JsonSchemaValidator2018":"cred:JsonSchemaValidator2018"}},"credentialStatus":{"@id":"cred:credentialStatus","@type":"@id"},"credentialSubject":{"@id":"cred:credentialSubject","@type":"@id"},"evidence":{"@id":"cred:evidence","@type":"@id"},"expirationDate":{"@id":"cred:expirationDate","@type":"xsd:dateTime"},"holder":{"@id":"cred:holder","@type":"@id"},"issued":{"@id":"cred:issued","@type":"xsd:dateTime"},"issuer":{"@id":"cred:issuer","@type":"@id"},"issuanceDate":{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","ManualRefreshService2018":"cred:ManualRefreshService2018"}},"termsOfUse":{"@id":"cred:termsOfUse","@type":"@id"},"validFrom":{"@id":"cred:validFrom","@type":"xsd:dateTime"},"validUntil":{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},"VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","holder":{"@id":"cred:holder","@type":"@id"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"verifiableCredential":{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"EcdsaSecp256r1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"Ed25519Signature2018":{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"RsaSignature2018":{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":true,"challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}}');
|
|
51
|
+
exports.CREDENTIALS_V2 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","description":"https://schema.org/description","digestMultibase":{"@id":"https://w3id.org/security#digestMultibase","@type":"https://w3id.org/security#multibase"},"digestSRI":{"@id":"https://www.w3.org/2018/credentials#digestSRI","@type":"https://www.w3.org/2018/credentials#sriString"},"mediaType":{"@id":"https://schema.org/encodingFormat"},"name":"https://schema.org/name","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@protected":true,"id":"@id","type":"@type","confidenceMethod":{"@id":"https://www.w3.org/2018/credentials#confidenceMethod","@type":"@id"},"credentialSchema":{"@id":"https://www.w3.org/2018/credentials#credentialSchema","@type":"@id"},"credentialStatus":{"@id":"https://www.w3.org/2018/credentials#credentialStatus","@type":"@id"},"credentialSubject":{"@id":"https://www.w3.org/2018/credentials#credentialSubject","@type":"@id"},"description":"https://schema.org/description","evidence":{"@id":"https://www.w3.org/2018/credentials#evidence","@type":"@id"},"issuer":{"@id":"https://www.w3.org/2018/credentials#issuer","@type":"@id"},"name":"https://schema.org/name","proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"https://www.w3.org/2018/credentials#refreshService","@type":"@id"},"relatedResource":{"@id":"https://www.w3.org/2018/credentials#relatedResource","@type":"@id"},"renderMethod":{"@id":"https://www.w3.org/2018/credentials#renderMethod","@type":"@id"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"validFrom":{"@id":"https://www.w3.org/2018/credentials#validFrom","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"validUntil":{"@id":"https://www.w3.org/2018/credentials#validUntil","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}},"EnvelopedVerifiableCredential":"https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential","VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@protected":true,"id":"@id","type":"@type","holder":{"@id":"https://www.w3.org/2018/credentials#holder","@type":"@id"},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"verifiableCredential":{"@id":"https://www.w3.org/2018/credentials#verifiableCredential","@type":"@id","@container":"@graph","@context":null}}},"EnvelopedVerifiablePresentation":"https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation","JsonSchemaCredential":"https://www.w3.org/2018/credentials#JsonSchemaCredential","JsonSchema":{"@id":"https://www.w3.org/2018/credentials#JsonSchema","@context":{"@protected":true,"id":"@id","type":"@type","jsonSchema":{"@id":"https://www.w3.org/2018/credentials#jsonSchema","@type":"@json"}}},"BitstringStatusListCredential":"https://www.w3.org/ns/credentials/status#BitstringStatusListCredential","BitstringStatusList":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusList","@context":{"@protected":true,"id":"@id","type":"@type","encodedList":{"@id":"https://www.w3.org/ns/credentials/status#encodedList","@type":"https://w3id.org/security#multibase"},"statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","ttl":"https://www.w3.org/ns/credentials/status#ttl"}},"BitstringStatusListEntry":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusListEntry","@context":{"@protected":true,"id":"@id","type":"@type","statusListCredential":{"@id":"https://www.w3.org/ns/credentials/status#statusListCredential","@type":"@id"},"statusListIndex":"https://www.w3.org/ns/credentials/status#statusListIndex","statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","statusMessage":{"@id":"https://www.w3.org/ns/credentials/status#statusMessage","@context":{"@protected":true,"id":"@id","type":"@type","message":"https://www.w3.org/ns/credentials/status#message","status":"https://www.w3.org/ns/credentials/status#status"}},"statusReference":{"@id":"https://www.w3.org/ns/credentials/status#statusReference","@type":"@id"},"statusSize":{"@id":"https://www.w3.org/ns/credentials/status#statusSize","@type":"https://www.w3.org/2001/XMLSchema#integer"}}},"DataIntegrityProof":{"@id":"https://w3id.org/security#DataIntegrityProof","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"cryptosuite":{"@id":"https://w3id.org/security#cryptosuite","@type":"https://w3id.org/security#cryptosuiteString"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","previousProof":{"@id":"https://w3id.org/security#previousProof","@type":"@id"},"proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}},"...":{"@id":"https://www.iana.org/assignments/jwt#..."},"_sd":{"@id":"https://www.iana.org/assignments/jwt#_sd","@type":"@json"},"_sd_alg":{"@id":"https://www.iana.org/assignments/jwt#_sd_alg"},"aud":{"@id":"https://www.iana.org/assignments/jwt#aud","@type":"@id"},"cnf":{"@id":"https://www.iana.org/assignments/jwt#cnf","@context":{"@protected":true,"kid":{"@id":"https://www.iana.org/assignments/jwt#kid","@type":"@id"},"jwk":{"@id":"https://www.iana.org/assignments/jwt#jwk","@type":"@json"}}},"exp":{"@id":"https://www.iana.org/assignments/jwt#exp","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iat":{"@id":"https://www.iana.org/assignments/jwt#iat","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iss":{"@id":"https://www.iana.org/assignments/jose#iss","@type":"@id"},"jku":{"@id":"https://www.iana.org/assignments/jose#jku","@type":"@id"},"kid":{"@id":"https://www.iana.org/assignments/jose#kid","@type":"@id"},"nbf":{"@id":"https://www.iana.org/assignments/jwt#nbf","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"sub":{"@id":"https://www.iana.org/assignments/jose#sub","@type":"@id"},"x5u":{"@id":"https://www.iana.org/assignments/jose#x5u","@type":"@id"}}}');
|
|
52
|
+
exports.CREDENTIALS_EXAMPLE_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/examples#"}}');
|
|
53
|
+
exports.CREDENTIALS_UNDEFINED_TERMS_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/undefined-term#"}}');
|
|
51
54
|
exports.CREDENTIALS_EXAMPLE_V1 = JSON.parse('{"@context":[{"@version":1.1},"https://www.w3.org/ns/odrl.jsonld",{"ex":"https://example.org/examples#","schema":"http://schema.org/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","3rdPartyCorrelation":"ex:3rdPartyCorrelation","AllVerifiers":"ex:AllVerifiers","Archival":"ex:Archival","BachelorDegree":"ex:BachelorDegree","Child":"ex:Child","CLCredentialDefinition2019":"ex:CLCredentialDefinition2019","CLSignature2019":"ex:CLSignature2019","IssuerPolicy":"ex:IssuerPolicy","HolderPolicy":"ex:HolderPolicy","Mother":"ex:Mother","RelationshipCredential":"ex:RelationshipCredential","UniversityDegreeCredential":"ex:UniversityDegreeCredential","AlumniCredential":"ex:AlumniCredential","DisputeCredential":"ex:DisputeCredential","PrescriptionCredential":"ex:PrescriptionCredential","ZkpExampleSchema2018":"ex:ZkpExampleSchema2018","issuerData":"ex:issuerData","attributes":"ex:attributes","signature":"ex:signature","signatureCorrectnessProof":"ex:signatureCorrectnessProof","primaryProof":"ex:primaryProof","nonRevocationProof":"ex:nonRevocationProof","alumniOf":{"@id":"schema:alumniOf","@type":"rdf:HTML"},"child":{"@id":"ex:child","@type":"@id"},"degree":"ex:degree","degreeType":"ex:degreeType","degreeSchool":"ex:degreeSchool","college":"ex:college","name":{"@id":"schema:name","@type":"rdf:HTML"},"givenName":"schema:givenName","familyName":"schema:familyName","parent":{"@id":"ex:parent","@type":"@id"},"referenceId":"ex:referenceId","documentPresence":"ex:documentPresence","evidenceDocument":"ex:evidenceDocument","spouse":"schema:spouse","subjectPresence":"ex:subjectPresence","verifier":{"@id":"ex:verifier","@type":"@id"},"currentStatus":"ex:currentStatus","statusReason":"ex:statusReason","prescription":"ex:prescription"}]}');
|
|
52
55
|
exports.DID_V1 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","alsoKnownAs":{"@id":"https://www.w3.org/ns/activitystreams#alsoKnownAs","@type":"@id"},"assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"},"service":{"@id":"https://www.w3.org/ns/did#service","@type":"@id","@context":{"@protected":true,"id":"@id","type":"@type","serviceEndpoint":{"@id":"https://www.w3.org/ns/did#serviceEndpoint","@type":"@id"}}},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}');
|
|
53
56
|
exports.ODRL = JSON.parse('{"@context":{"odrl":"http://www.w3.org/ns/odrl/2/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdfs":"http://www.w3.org/2000/01/rdf-schema#","owl":"http://www.w3.org/2002/07/owl#","skos":"http://www.w3.org/2004/02/skos/core#","dct":"http://purl.org/dc/terms/","xsd":"http://www.w3.org/2001/XMLSchema#","vcard":"http://www.w3.org/2006/vcard/ns#","foaf":"http://xmlns.com/foaf/0.1/","schema":"http://schema.org/","cc":"http://creativecommons.org/ns#","uid":"@id","type":"@type","Policy":"odrl:Policy","Rule":"odrl:Rule","profile":{"@type":"@id","@id":"odrl:profile"},"inheritFrom":{"@type":"@id","@id":"odrl:inheritFrom"},"ConflictTerm":"odrl:ConflictTerm","conflict":{"@type":"@vocab","@id":"odrl:conflict"},"perm":"odrl:perm","prohibit":"odrl:prohibit","invalid":"odrl:invalid","Agreement":"odrl:Agreement","Assertion":"odrl:Assertion","Offer":"odrl:Offer","Privacy":"odrl:Privacy","Request":"odrl:Request","Set":"odrl:Set","Ticket":"odrl:Ticket","Asset":"odrl:Asset","AssetCollection":"odrl:AssetCollection","relation":{"@type":"@id","@id":"odrl:relation"},"hasPolicy":{"@type":"@id","@id":"odrl:hasPolicy"},"target":{"@type":"@id","@id":"odrl:target"},"output":{"@type":"@id","@id":"odrl:output"},"partOf":{"@type":"@id","@id":"odrl:partOf"},"source":{"@type":"@id","@id":"odrl:source"},"Party":"odrl:Party","PartyCollection":"odrl:PartyCollection","function":{"@type":"@vocab","@id":"odrl:function"},"PartyScope":"odrl:PartyScope","assignee":{"@type":"@id","@id":"odrl:assignee"},"assigner":{"@type":"@id","@id":"odrl:assigner"},"assigneeOf":{"@type":"@id","@id":"odrl:assigneeOf"},"assignerOf":{"@type":"@id","@id":"odrl:assignerOf"},"attributedParty":{"@type":"@id","@id":"odrl:attributedParty"},"attributingParty":{"@type":"@id","@id":"odrl:attributingParty"},"compensatedParty":{"@type":"@id","@id":"odrl:compensatedParty"},"compensatingParty":{"@type":"@id","@id":"odrl:compensatingParty"},"consentingParty":{"@type":"@id","@id":"odrl:consentingParty"},"consentedParty":{"@type":"@id","@id":"odrl:consentedParty"},"informedParty":{"@type":"@id","@id":"odrl:informedParty"},"informingParty":{"@type":"@id","@id":"odrl:informingParty"},"trackingParty":{"@type":"@id","@id":"odrl:trackingParty"},"trackedParty":{"@type":"@id","@id":"odrl:trackedParty"},"contractingParty":{"@type":"@id","@id":"odrl:contractingParty"},"contractedParty":{"@type":"@id","@id":"odrl:contractedParty"},"Action":"odrl:Action","action":{"@type":"@vocab","@id":"odrl:action"},"includedIn":{"@type":"@id","@id":"odrl:includedIn"},"implies":{"@type":"@id","@id":"odrl:implies"},"Permission":"odrl:Permission","permission":{"@type":"@id","@id":"odrl:permission"},"Prohibition":"odrl:Prohibition","prohibition":{"@type":"@id","@id":"odrl:prohibition"},"obligation":{"@type":"@id","@id":"odrl:obligation"},"use":"odrl:use","grantUse":"odrl:grantUse","aggregate":"odrl:aggregate","annotate":"odrl:annotate","anonymize":"odrl:anonymize","archive":"odrl:archive","concurrentUse":"odrl:concurrentUse","derive":"odrl:derive","digitize":"odrl:digitize","display":"odrl:display","distribute":"odrl:distribute","execute":"odrl:execute","extract":"odrl:extract","give":"odrl:give","index":"odrl:index","install":"odrl:install","modify":"odrl:modify","move":"odrl:move","play":"odrl:play","present":"odrl:present","print":"odrl:print","read":"odrl:read","reproduce":"odrl:reproduce","sell":"odrl:sell","stream":"odrl:stream","textToSpeech":"odrl:textToSpeech","transfer":"odrl:transfer","transform":"odrl:transform","translate":"odrl:translate","Duty":"odrl:Duty","duty":{"@type":"@id","@id":"odrl:duty"},"consequence":{"@type":"@id","@id":"odrl:consequence"},"remedy":{"@type":"@id","@id":"odrl:remedy"},"acceptTracking":"odrl:acceptTracking","attribute":"odrl:attribute","compensate":"odrl:compensate","delete":"odrl:delete","ensureExclusivity":"odrl:ensureExclusivity","include":"odrl:include","inform":"odrl:inform","nextPolicy":"odrl:nextPolicy","obtainConsent":"odrl:obtainConsent","reviewPolicy":"odrl:reviewPolicy","uninstall":"odrl:uninstall","watermark":"odrl:watermark","Constraint":"odrl:Constraint","LogicalConstraint":"odrl:LogicalConstraint","constraint":{"@type":"@id","@id":"odrl:constraint"},"refinement":{"@type":"@id","@id":"odrl:refinement"},"Operator":"odrl:Operator","operator":{"@type":"@vocab","@id":"odrl:operator"},"RightOperand":"odrl:RightOperand","rightOperand":"odrl:rightOperand","rightOperandReference":{"@type":"xsd:anyURI","@id":"odrl:rightOperandReference"},"LeftOperand":"odrl:LeftOperand","leftOperand":{"@type":"@vocab","@id":"odrl:leftOperand"},"unit":"odrl:unit","dataType":{"@type":"xsd:anyType","@id":"odrl:datatype"},"status":"odrl:status","absolutePosition":"odrl:absolutePosition","absoluteSpatialPosition":"odrl:absoluteSpatialPosition","absoluteTemporalPosition":"odrl:absoluteTemporalPosition","absoluteSize":"odrl:absoluteSize","count":"odrl:count","dateTime":"odrl:dateTime","delayPeriod":"odrl:delayPeriod","deliveryChannel":"odrl:deliveryChannel","elapsedTime":"odrl:elapsedTime","event":"odrl:event","fileFormat":"odrl:fileFormat","industry":"odrl:industry:","language":"odrl:language","media":"odrl:media","meteredTime":"odrl:meteredTime","payAmount":"odrl:payAmount","percentage":"odrl:percentage","product":"odrl:product","purpose":"odrl:purpose","recipient":"odrl:recipient","relativePosition":"odrl:relativePosition","relativeSpatialPosition":"odrl:relativeSpatialPosition","relativeTemporalPosition":"odrl:relativeTemporalPosition","relativeSize":"odrl:relativeSize","resolution":"odrl:resolution","spatial":"odrl:spatial","spatialCoordinates":"odrl:spatialCoordinates","systemDevice":"odrl:systemDevice","timeInterval":"odrl:timeInterval","unitOfCount":"odrl:unitOfCount","version":"odrl:version","virtualLocation":"odrl:virtualLocation","eq":"odrl:eq","gt":"odrl:gt","gteq":"odrl:gteq","lt":"odrl:lt","lteq":"odrl:lteq","neq":"odrl:neq","isA":"odrl:isA","hasPart":"odrl:hasPart","isPartOf":"odrl:isPartOf","isAllOf":"odrl:isAllOf","isAnyOf":"odrl:isAnyOf","isNoneOf":"odrl:isNoneOf","or":"odrl:or","xone":"odrl:xone","and":"odrl:and","andSequence":"odrl:andSequence","policyUsage":"odrl:policyUsage"}}');
|
|
@@ -66,7 +69,10 @@ const DEFAULT_CONTEXTS = {
|
|
|
66
69
|
'https://w3id.org/security/suites/ed25519-2020/v1': exports.ED25519_2020_V1,
|
|
67
70
|
'https://w3id.org/security/suites/secp256k1-2019/v1': exports.SECP256K1_2019_V1,
|
|
68
71
|
'https://www.w3.org/2018/credentials/v1': exports.CREDENTIALS_V1,
|
|
72
|
+
'https://www.w3.org/ns/credentials/v2': exports.CREDENTIALS_V2,
|
|
69
73
|
'https://www.w3.org/2018/credentials/examples/v1': exports.CREDENTIALS_EXAMPLE_V1,
|
|
74
|
+
'https://www.w3.org/ns/credentials/examples/v2': exports.CREDENTIALS_EXAMPLE_V2,
|
|
75
|
+
'https://www.w3.org/ns/credentials/undefined-terms/v2': exports.CREDENTIALS_UNDEFINED_TERMS_V2,
|
|
70
76
|
'https://w3id.org/did/v1': exports.DID_V1,
|
|
71
77
|
'https://www.w3.org/ns/did/v1': exports.DID_V1,
|
|
72
78
|
'https://w3.org/ns/did/v1': exports.DID_V1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,sDAuDC;AAjJD,iCAAiC;AACjC,yCAAoG;AAEvF,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,ouDAAouD,CACruD,CAAA;AACY,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,4wFAA4wF,CAC7wF,CAAA;AACY,QAAA,SAAS,GAAG,IAAI,CAAC,KAAK,CACjC,ycAAyc,CAC1c,CAAA;AACY,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,ksBAAksB,CACnsB,CAAA;AACY,QAAA,eAAe,GAAG,IAAI,CAAC,KAAK,CACvC,s0DAAs0D,CACv0D,CAAA;AACY,QAAA,eAAe,GAAG,IAAI,CAAC,KAAK,CACvC,s7DAAs7D,CACv7D,CA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 +43,7 @@ function setupBaseDidComm(options) {
|
|
|
43
43
|
credentialFormats: [
|
|
44
44
|
new anoncreds_1.LegacyIndyDidCommCredentialFormatService(),
|
|
45
45
|
new anoncreds_1.AnonCredsDidCommCredentialFormatService(),
|
|
46
|
-
new didcomm_1.
|
|
46
|
+
new didcomm_1.DidCommDataIntegrityCredentialFormatService(),
|
|
47
47
|
],
|
|
48
48
|
}),
|
|
49
49
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupBaseDidComm.js","sourceRoot":"","sources":["../../src/plugins/setupBaseDidComm.ts"],"names":[],"mappings":";;AAiDA,4CAkEC;AAjHD,mDAM4B;AAC5B,2CAA4E;AAC5E,yCAAiE;AACjE,+CAQ0B;AAC1B,2CAA6F;AAC7F,oEAAyD;AACzD,sEAA2D;AAC3D,oFAAoG;AACpG,yEAAmE;AAGnE,8EAA0E;AAC1E,sEAAmE;AACnE,sEAAkE;AAClE,4DAAwD;AACxD,yFAAqF;AAcrF;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAiC;;IAChE,MAAM,eAAe,GAAG,MAAA,OAAO,CAAC,eAAe,mCAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC/D,OAAO;QACL,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,uBAAa,CAAC;gBACzB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,eAAe;gBACf,2FAA2F;gBAC3F,aAAa,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE;gBAC7C,UAAU,EAAE;oBACV,QAAQ,EAAE,CAAC,IAAI,sCAA4B,EAAE,EAAE,IAAI,uDAA0B,EAAE,CAAC;iBACjF;gBACD,WAAW,EAAE;oBACX,qBAAqB,EAAE,IAAI;oBAC3B,kCAAkC,EAAE,IAAI;iBACzC;gBACD,WAAW,EAAE;oBACX,qBAAqB,EAAE,qCAA2B,CAAC,eAAe;oBAClE,mBAAmB,EAAE;wBACnB,IAAI,qCAA2B,CAAC;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AAe;oBACxD,cAAc,EAAE;wBACd,IAAI,gCAAsB,CAAC;4BACzB,YAAY,EAAE;gCACZ,IAAI,+CAAmC,EAAE;gCACzC,IAAI,8CAAkC,EAAE;6BACzC;yBACF,CAAC;qBACH;iBACF;aACF,CAAC;YACF,KAAK,EAAE,IAAI,mBAAW,CAAC;gBACrB,KAAK,EAAL,oBAAK;gBACL,KAAK,EAAE,OAAO,CAAC,YAAY;aAC5B,CAAC;YACF,SAAS,EAAE,IAAI,2BAAe,CAAC;gBAC7B,SAAS,EAAT,4BAAS;gBACT,gBAAgB,EAAE,IAAI,2CAAoB,CAAC;oBACzC,kBAAkB,EAAE,GAAG,OAAO,CAAC,gBAAgB,qBAAqB;iBACrE,CAAC;gBACF,UAAU,EAAE;oBACV,IAAI,mDAAuB,CAAC;wBAC1B,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;qBAC3E,CAAC;oBACF,IAAI,8BAAsB,EAAE;iBAC7B;aACF,CAAC;YACF,IAAI,EAAE,IAAI,iBAAU,CAAC;gBACnB,SAAS,EAAE,CAAC,IAAI,2CAAoB,EAAE,EAAE,IAAI,wBAAgB,EAAE,CAAC;gBAC/D,UAAU,EAAE,CAAC,IAAI,iCAAe,EAAE,EAAE,IAAI,yBAAiB,EAAE,CAAC;aAC7D,CAAC;YACF,cAAc,EAAE,IAAI,2BAAoB,CAAC;gBACvC,cAAc,EAAE,4CAAqB;aACtC,CAAC;YACF,MAAM,EAAE,IAAI,uCAAY,mBAAM,OAAO,CAAC,MAAM,EAAG;SAChD;KACF,CAAA;AACH,CAAC"}
|
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
|
@@ -20,5 +20,6 @@ __exportStar(require("./ecsClaims"), exports);
|
|
|
20
20
|
__exportStar(require("./setupSelfTr"), exports);
|
|
21
21
|
__exportStar(require("./trustCredentialStore"), exports);
|
|
22
22
|
__exportStar(require("./util"), exports);
|
|
23
|
+
__exportStar(require("./vcdm2"), exports);
|
|
23
24
|
__exportStar(require("./vtjscResolver"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/build/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B;AAC3B,gDAA6B;AAC7B,yDAAsC;AACtC,yCAAsB;AACtB,kDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B;AAC3B,gDAA6B;AAC7B,yDAAsC;AACtC,yCAAsB;AACtB,0CAAuB;AACvB,kDAA+B"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { W3cCredentialSchema } from '@credo-ts/core';
|
|
2
2
|
import { VsAgent } from '../agent/VsAgent';
|
|
3
3
|
import { EcsClaims } from './ecsClaims';
|
|
4
|
-
|
|
4
|
+
/** The linked presentation as published: VC Data Model 2.0 JSON secured with Data Integrity proofs */
|
|
5
|
+
export type SelfIssuedEcsPresentation = Record<string, unknown> & {
|
|
6
|
+
verifiableCredential: Record<string, unknown>[];
|
|
7
|
+
};
|
|
8
|
+
export declare function publishSelfIssuedEcsPresentation(agent: VsAgent, id: string, ecsSchemas: Record<string, string>, schemaKey: string, type: string[], credentialSchema: W3cCredentialSchema, ecsClaims: EcsClaims, beforePublish?: (verifiablePresentation: SelfIssuedEcsPresentation) => Promise<void>): Promise<SelfIssuedEcsPresentation>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.publishSelfIssuedEcsPresentation = publishSelfIssuedEcsPresentation;
|
|
4
4
|
const core_1 = require("@credo-ts/core");
|
|
5
5
|
const setupSelfTr_1 = require("./setupSelfTr");
|
|
6
|
+
const vcdm2_1 = require("./vcdm2");
|
|
6
7
|
const buildIntegrityData = (data) => {
|
|
7
8
|
return (0, setupSelfTr_1.generateDigestSRI)(JSON.stringify((0, setupSelfTr_1.sortKeysDeep)(data)));
|
|
8
9
|
};
|
|
@@ -10,6 +11,9 @@ function storedCredentialIsCurrent(credential, credentialSchemaId, did, didRecor
|
|
|
10
11
|
var _a, _b, _c;
|
|
11
12
|
if (!credential)
|
|
12
13
|
return false;
|
|
14
|
+
// a credential published by an older agent as data model 1.1 is rebuilt on upgrade
|
|
15
|
+
if (!(0, vcdm2_1.isDataIntegrityVcdm2Credential)(credential))
|
|
16
|
+
return false;
|
|
13
17
|
const issuer = typeof credential.issuer === 'string' ? credential.issuer : (_a = credential.issuer) === null || _a === void 0 ? void 0 : _a.id;
|
|
14
18
|
if (issuer !== did)
|
|
15
19
|
return false;
|
|
@@ -28,18 +32,27 @@ function storedCredentialIsCurrent(credential, credentialSchemaId, did, didRecor
|
|
|
28
32
|
const assertionMethods = new Set(((_c = (_b = didRecord.didDocument) === null || _b === void 0 ? void 0 : _b.assertionMethod) !== null && _c !== void 0 ? _c : []).map(entry => typeof entry === 'string' ? entry : entry.id));
|
|
29
33
|
return proofs.every(proof => !!proof.verificationMethod && assertionMethods.has(proof.verificationMethod));
|
|
30
34
|
}
|
|
31
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Issues the ECS credential to the agent itself and wraps it in the linked presentation, both
|
|
37
|
+
* secured with a DataIntegrityProof by the DID Document assertion key.
|
|
38
|
+
*/
|
|
39
|
+
async function signSelfIssuedEcsCredential(agent, didRecord, presentationId, type, claims, credentialSchema) {
|
|
32
40
|
const unsignedCredential = (0, setupSelfTr_1.createCredential)({
|
|
33
41
|
id: agent.did,
|
|
34
42
|
type,
|
|
35
43
|
issuer: agent.did,
|
|
36
|
-
credentialSubject: { id: agent.did
|
|
44
|
+
credentialSubject: Object.assign(Object.assign({}, claims), { id: agent.did }),
|
|
45
|
+
credentialSchema: { id: credentialSchema.id, type: credentialSchema.type },
|
|
37
46
|
});
|
|
38
|
-
unsignedCredential.credentialSchema = credentialSchema;
|
|
39
47
|
const verificationMethodId = (0, setupSelfTr_1.getVerificationMethodId)(agent.config.logger, didRecord);
|
|
40
48
|
const signedCredential = await (0, setupSelfTr_1.signerW3c)(agent, unsignedCredential, verificationMethodId);
|
|
41
|
-
presentation
|
|
42
|
-
|
|
49
|
+
const presentation = (0, setupSelfTr_1.createPresentation)({
|
|
50
|
+
id: presentationId,
|
|
51
|
+
holder: agent.did,
|
|
52
|
+
verifiableCredential: [signedCredential],
|
|
53
|
+
});
|
|
54
|
+
const signedPresentation = await (0, setupSelfTr_1.signerW3c)(agent, presentation, verificationMethodId);
|
|
55
|
+
return signedPresentation.securedPresentation;
|
|
43
56
|
}
|
|
44
57
|
async function publishSelfIssuedEcsPresentation(agent, id, ecsSchemas, schemaKey, type, credentialSchema, ecsClaims, beforePublish) {
|
|
45
58
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -68,12 +81,7 @@ async function publishSelfIssuedEcsPresentation(agent, id, ecsSchemas, schemaKey
|
|
|
68
81
|
await (beforePublish === null || beforePublish === void 0 ? void 0 : beforePublish(metadata.verifiablePresentation));
|
|
69
82
|
return metadata.verifiablePresentation;
|
|
70
83
|
}
|
|
71
|
-
const
|
|
72
|
-
id,
|
|
73
|
-
holder: agent.did,
|
|
74
|
-
verifiableCredential: [],
|
|
75
|
-
});
|
|
76
|
-
const verifiablePresentation = await signSelfIssuedEcsCredential(agent, didRecord, type, claims, credentialSchema, presentation);
|
|
84
|
+
const verifiablePresentation = await signSelfIssuedEcsCredential(agent, didRecord, id, type, claims, credentialSchema);
|
|
77
85
|
// nothing is persisted yet, so a failure here leaves no public presentation behind
|
|
78
86
|
if (attached)
|
|
79
87
|
await (beforePublish === null || beforePublish === void 0 ? void 0 : beforePublish(verifiablePresentation));
|
|
@@ -120,9 +128,7 @@ async function publishSelfIssuedEcsPresentation(agent, id, ecsSchemas, schemaKey
|
|
|
120
128
|
didDocumentChanged = true;
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
|
-
const credential =
|
|
124
|
-
? verifiablePresentation.verifiableCredential[0]
|
|
125
|
-
: verifiablePresentation.verifiableCredential;
|
|
131
|
+
const [credential] = verifiablePresentation.verifiableCredential;
|
|
126
132
|
record[credentialSchema.id] = {
|
|
127
133
|
credential,
|
|
128
134
|
verifiablePresentation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfIssuedEcsCredential.js","sourceRoot":"","sources":["../../src/utils/selfIssuedEcsCredential.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"selfIssuedEcsCredential.js","sourceRoot":"","sources":["../../src/utils/selfIssuedEcsCredential.ts"],"names":[],"mappings":";;AA8FA,4EAoGC;AAlMD,yCAAkG;AAIlG,+CASsB;AACtB,mCAAwD;AAExD,MAAM,kBAAkB,GAAG,CAAC,IAA6B,EAAE,EAAE;IAC3D,OAAO,IAAA,+BAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,IAAA,0BAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC,CAAA;AAQD,SAAS,yBAAyB,CAChC,UAAkD,EAClD,kBAA0B,EAC1B,GAAW,EACX,SAAoB;;IAEpB,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAA;IAC7B,mFAAmF;IACnF,IAAI,CAAC,IAAA,sCAA8B,EAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAA;IAE7D,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAA,UAAU,CAAC,MAAM,0CAAE,EAAE,CAAA;IAChG,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,KAAK,CAAA;IAEhC,MAAM,MAAM,GAAG,KAAK,CAAC,OAA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AO,EAAE,SAAS,CAAC,CAAA;IAC7F,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,CAAA;IAC9D,CAAC;IACD,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DidRecord, Logger, W3cCredentialSchema, W3cCredentialSubject, W3cV2Credential, W3cV2CredentialOptions, W3cV2DataIntegrityVerifiableCredential, W3cV2DataIntegrityVerifiablePresentation, W3cV2Presentation, W3cV2PresentationOptions } from '@credo-ts/core';
|
|
2
2
|
import { AnySchemaObject } from 'ajv/dist/2020';
|
|
3
3
|
import { VsAgent } from '../agent/VsAgent';
|
|
4
4
|
import { EcsClaims } from './ecsClaims';
|
|
@@ -6,21 +6,36 @@ export declare const createJsonSchema: W3cCredentialSchema;
|
|
|
6
6
|
export declare const createJsonSubjectRef: (id: string) => W3cCredentialSubject;
|
|
7
7
|
export declare const linkedVpFragment: (schemaKey: string) => string;
|
|
8
8
|
export declare const sortKeysDeep: (value: unknown) => unknown;
|
|
9
|
-
export declare function createCredential(options: Partial<W3cCredentialOptions>): W3cCredential;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* Builds an unsigned credential: a VC Data Model 2.0 credential, as
|
|
11
|
+
* [VT-CRED-W3C] and [VT-JSON-SCHEMA-CRED-W3C] require the `https://www.w3.org/ns/credentials/v2`
|
|
12
|
+
* context, valid from now for ten years unless told otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createCredential(options: Partial<W3cV2CredentialOptions>): W3cV2Credential;
|
|
15
|
+
/**
|
|
16
|
+
* The Data Integrity cryptosuite this agent is configured with, read from the registered
|
|
17
|
+
* `VtFlowModuleConfig` so the self issued credentials are secured and linked VPs with the
|
|
18
|
+
* same suite `VtFlowApi.issueCredentialForSession` applies to the credentials it issues. Falls back
|
|
19
|
+
* to the module default when the vt-flow module is not registered on the agent.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getDataIntegrityCryptosuite(agent: Pick<VsAgent, 'context'>): string;
|
|
22
|
+
/**
|
|
23
|
+
* Secures a W3C credential or presentation with a Data Integrity proof under the cryptosuite the
|
|
24
|
+
* agent is configured with, using the provided verification method.
|
|
12
25
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
26
|
+
* A credential is secured for `assertionMethod` and a presentation for `authentication`, the proof
|
|
27
|
+
* purposes VC Data Integrity defines for each; the presentation is published from the DID Document
|
|
28
|
+
* rather than presented to a verifier, so it carries no challenge.
|
|
15
29
|
*
|
|
16
30
|
* @param agent - The agent instance.
|
|
17
31
|
* @param obj - The credential or presentation object to be signed.
|
|
18
32
|
* @param verificationMethod - The DID verification method used to generate the proof.
|
|
19
|
-
* @returns
|
|
33
|
+
* @returns The secured credential or presentation, wrapping the JSON that gets published.
|
|
20
34
|
*/
|
|
21
|
-
export declare function signerW3c(agent: VsAgent, obj:
|
|
22
|
-
export declare function signerW3c(agent: VsAgent, obj:
|
|
23
|
-
|
|
35
|
+
export declare function signerW3c(agent: VsAgent, obj: W3cV2Credential, verificationMethod: string): Promise<W3cV2DataIntegrityVerifiableCredential>;
|
|
36
|
+
export declare function signerW3c(agent: VsAgent, obj: W3cV2Presentation, verificationMethod: string): Promise<W3cV2DataIntegrityVerifiablePresentation>;
|
|
37
|
+
/** Builds an unsigned VC Data Model 2.0 presentation; the class supplies the v2 context. */
|
|
38
|
+
export declare function createPresentation(options: Partial<W3cV2PresentationOptions>): W3cV2Presentation;
|
|
24
39
|
/**
|
|
25
40
|
* Retrieves and validates claims for a credential subject.
|
|
26
41
|
* If claims are not found, builds default claims based on the schemaKey.
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sortKeysDeep = exports.linkedVpFragment = exports.createJsonSubjectRef = exports.createJsonSchema = void 0;
|
|
7
7
|
exports.createCredential = createCredential;
|
|
8
|
+
exports.getDataIntegrityCryptosuite = getDataIntegrityCryptosuite;
|
|
8
9
|
exports.signerW3c = signerW3c;
|
|
9
10
|
exports.createPresentation = createPresentation;
|
|
10
11
|
exports.getClaims = getClaims;
|
|
@@ -13,15 +14,13 @@ exports.addDigestSRI = addDigestSRI;
|
|
|
13
14
|
exports.generateDigestSRI = generateDigestSRI;
|
|
14
15
|
exports.getVerificationMethodId = getVerificationMethodId;
|
|
15
16
|
const core_1 = require("@credo-ts/core");
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
|
-
//@ts-expect-error
|
|
19
|
-
const jsonld_signatures_1 = require("@digitalcredentials/jsonld-signatures");
|
|
17
|
+
const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
|
|
20
18
|
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
21
19
|
const _2020_1 = __importDefault(require("ajv/dist/2020"));
|
|
22
20
|
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
|
23
21
|
const crypto_1 = require("crypto");
|
|
24
22
|
const ecsClaims_1 = require("./ecsClaims");
|
|
23
|
+
const vcdm2_1 = require("./vcdm2");
|
|
25
24
|
const ajv = new _2020_1.default({ strict: false, allErrors: true });
|
|
26
25
|
(0, ajv_formats_1.default)(ajv);
|
|
27
26
|
exports.createJsonSchema = {
|
|
@@ -60,45 +59,48 @@ const sortKeysDeep = (value) => {
|
|
|
60
59
|
return value;
|
|
61
60
|
};
|
|
62
61
|
exports.sortKeysDeep = sortKeysDeep;
|
|
62
|
+
/**
|
|
63
|
+
* Builds an unsigned credential: a VC Data Model 2.0 credential, as
|
|
64
|
+
* [VT-CRED-W3C] and [VT-JSON-SCHEMA-CRED-W3C] require the `https://www.w3.org/ns/credentials/v2`
|
|
65
|
+
* context, valid from now for ten years unless told otherwise.
|
|
66
|
+
*/
|
|
63
67
|
function createCredential(options) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
return (0, vcdm2_1.createW3cV2Credential)(options);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The Data Integrity cryptosuite this agent is configured with, read from the registered
|
|
72
|
+
* `VtFlowModuleConfig` so the self issued credentials are secured and linked VPs with the
|
|
73
|
+
* same suite `VtFlowApi.issueCredentialForSession` applies to the credentials it issues. Falls back
|
|
74
|
+
* to the module default when the vt-flow module is not registered on the agent.
|
|
75
|
+
*/
|
|
76
|
+
function getDataIntegrityCryptosuite(agent) {
|
|
77
|
+
const { dependencyManager } = agent.context;
|
|
78
|
+
return dependencyManager.isRegistered(credo_ts_didcomm_vt_flow_1.VtFlowModuleConfig)
|
|
79
|
+
? dependencyManager.resolve(credo_ts_didcomm_vt_flow_1.VtFlowModuleConfig).dataIntegrityCryptosuite
|
|
80
|
+
: credo_ts_didcomm_vt_flow_1.DEFAULT_DATA_INTEGRITY_CRYPTOSUITE;
|
|
72
81
|
}
|
|
73
82
|
async function signerW3c(agent, obj, verificationMethod) {
|
|
74
|
-
const
|
|
75
|
-
if (obj instanceof core_1.
|
|
76
|
-
return await agent.
|
|
77
|
-
format: core_1.ClaimFormat.
|
|
83
|
+
const cryptosuite = getDataIntegrityCryptosuite(agent);
|
|
84
|
+
if (obj instanceof core_1.W3cV2Credential) {
|
|
85
|
+
return await agent.w3cV2Credentials.signCredential({
|
|
86
|
+
format: core_1.ClaimFormat.DiVc,
|
|
78
87
|
credential: obj,
|
|
79
|
-
|
|
88
|
+
cryptosuite,
|
|
80
89
|
verificationMethod,
|
|
81
|
-
proofPurpose,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
if (obj instanceof core_1.W3cPresentation) {
|
|
85
|
-
return await agent.w3cCredentials.signPresentation({
|
|
86
|
-
format: core_1.ClaimFormat.LdpVp,
|
|
87
|
-
presentation: obj,
|
|
88
|
-
proofType: 'Ed25519Signature2020',
|
|
89
|
-
verificationMethod,
|
|
90
|
-
proofPurpose,
|
|
91
90
|
});
|
|
92
91
|
}
|
|
92
|
+
// The options type requires a challenge for every presentation format, while a Data Integrity
|
|
93
|
+
// proof only carries one when it is given
|
|
94
|
+
return await agent.w3cV2Credentials.signPresentation({
|
|
95
|
+
format: core_1.ClaimFormat.DiVp,
|
|
96
|
+
presentation: obj,
|
|
97
|
+
cryptosuite,
|
|
98
|
+
verificationMethod,
|
|
99
|
+
});
|
|
93
100
|
}
|
|
101
|
+
/** Builds an unsigned VC Data Model 2.0 presentation; the class supplies the v2 context. */
|
|
94
102
|
function createPresentation(options) {
|
|
95
|
-
|
|
96
|
-
(_a = options.context) !== null && _a !== void 0 ? _a : (options.context = [
|
|
97
|
-
'https://www.w3.org/2018/credentials/v1',
|
|
98
|
-
'https://www.w3.org/ns/credentials/examples/v2',
|
|
99
|
-
]);
|
|
100
|
-
(_b = options.type) !== null && _b !== void 0 ? _b : (options.type = ['VerifiablePresentation']);
|
|
101
|
-
return new core_1.W3cPresentation(options);
|
|
103
|
+
return new core_1.W3cV2Presentation(Object.assign({ type: ['VerifiablePresentation'] }, options));
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
106
|
* Retrieves and validates claims for a credential subject.
|
|
@@ -213,7 +215,7 @@ function getVerificationMethodId(logger, didRecord) {
|
|
|
213
215
|
method.id === ((_b = (_a = didRecord.didDocument) === null || _a === void 0 ? void 0 : _a.assertionMethod) === null || _b === void 0 ? void 0 : _b[0]);
|
|
214
216
|
});
|
|
215
217
|
if (!verificationMethod) {
|
|
216
|
-
throw new Error('Cannot find a suitable
|
|
218
|
+
throw new Error('Cannot find a suitable Ed25519 verification method in DID Document');
|
|
217
219
|
}
|
|
218
220
|
return verificationMethod.id;
|
|
219
221
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupSelfTr.js","sourceRoot":"","sources":["../../src/utils/setupSelfTr.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"setupSelfTr.js","sourceRoot":"","sources":["../../src/utils/setupSelfTr.ts"],"names":[],"mappings":";;;;;;AAqEA,4CAEC;AAQD,kEAKC;AA2BD,8BAwBC;AAGD,gDAEC;AAaD,8BAkBC;AAMD,wCAcC;AAuBD,oCAuBC;AA2BD,8CAGC;AAED,0DAeC;AA5RD,yCAauB;AACvB,oFAA8G;AAC9G,gEAA4D;AAC5D,0DAAoD;AACpD,8DAAoC;AACpC,mCAAmC;AAGnC,2CAAyD;AACzD,mCAA+C;AAE/C,MAAM,GAAG,GAAG,IAAI,eAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AACvD,IAAA,qBAAU,EAAC,GAAG,CAAC,CAAA;AAEF,QAAA,gBAAgB,GAAwB;IACnD,EAAE,EAAE,uDAAuD;IAC3D,IAAI,EAAE,YAAY;CACnB,CAAA;AAEM,MAAM,oBAAoB,GAAG,CAAC,EAAU,EAAwB,EAAE,CAAC,CAAC;IACzE,EAAE;IACF,MAAM,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE;SACT;KACF;CACF,CAAC,CAAA;AARW,QAAA,oBAAoB,wBAQ/B;AAEF,8CAA8C;AACvC,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAU,EAAE,CAC5D,eAAe,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAA;AAD3C,QAAA,gBAAgB,oBAC2B;AAExD,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,yEAAyE;AACzE,uEAAuE;AAChE,MAAM,YAAY,GAAG,CAAC,KAAc,EAAW,EAAE;IACtD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK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,EAAE,YAAoB,QAAQ;IAC7E,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IACnE,OAAO,GAAG,SAAS,IAAI,IAAI,EAAE,CAAA;AAC/B,CAAC;AAED,SAAgB,uBAAuB,CAAC,MAAc,EAAE,SAAoB;;IAC1E,IAAI,CAAC;QACH,MAAM,kBAAkB,GAAG,MAAA,MAAA,SAAS,CAAC,WAAW,0CAAE,kBAAkB,0CAAE,IAAI,CACxE,MAAM,CAAC,EAAE;;YACP,OAAA,CAAC,MAAM,CAAC,IAAI,KAAK,4BAA4B,IAAI,MAAM,CAAC,IAAI,KAAK,4BAA4B,CAAC;gBAC9F,MAAM,CAAC,EAAE,MAAK,MAAA,MAAA,SAAS,CAAC,WAAW,0CAAE,eAAe,0CAAG,CAAC,CAAC,CAAA,CAAA;SAAA,CAC5D,CAAA;QACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAA;QACvF,CAAC;QACD,OAAO,kBAAkB,CAAC,EAAE,CAAA;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAA;QAC5D,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +1,51 @@
|
|
|
1
|
-
import { DidRecord, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation } from '@credo-ts/core';
|
|
1
|
+
import { DidRecord, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation, type W3cV2DataIntegritySecuredCredential, W3cV2DataIntegrityVerifiableCredential, W3cV2DataIntegrityVerifiablePresentation } from '@credo-ts/core';
|
|
2
2
|
import { VsAgent } from '../agent/VsAgent';
|
|
3
3
|
import { EcsClaims } from './ecsClaims';
|
|
4
|
+
/**
|
|
5
|
+
* A trust credential the agent publishes from its DID Document: a VC Data Model 2.0 credential
|
|
6
|
+
* secured with a DataIntegrityProof, which is what the agent issues itself and receives over the
|
|
7
|
+
* RFC 0809 credential format, or a data model 1.1 credential carrying a linked data proof that an
|
|
8
|
+
* older issuer handed over.
|
|
9
|
+
*/
|
|
10
|
+
export type TrustCredential = W3cJsonLdVerifiableCredential | W3cV2DataIntegrityVerifiableCredential;
|
|
11
|
+
export type TrustPresentation = W3cJsonLdVerifiablePresentation | W3cV2DataIntegrityVerifiablePresentation;
|
|
12
|
+
/**
|
|
13
|
+
* Wraps a VC Data Model 2.0 credential in a data model 2.0 presentation secured with a
|
|
14
|
+
* DataIntegrityProof under the cryptosuite the agent is configured with, the counterpart of the
|
|
15
|
+
* linked data proof a data model 1.1 linked VP carries. The presentation is published from the DID
|
|
16
|
+
* Document rather than presented to a verifier, so there is no challenge to bind; its proof purpose
|
|
17
|
+
* is `authentication`, as Data Integrity defines for presentations.
|
|
18
|
+
*/
|
|
19
|
+
export declare function signLinkedDataIntegrityPresentation(agent: Pick<VsAgent, 'w3cV2Credentials' | 'context'>, options: {
|
|
20
|
+
id: string;
|
|
21
|
+
holder: string;
|
|
22
|
+
credential: W3cV2DataIntegrityVerifiableCredential;
|
|
23
|
+
verificationMethodId: string;
|
|
24
|
+
}): Promise<W3cV2DataIntegrityVerifiablePresentation>;
|
|
4
25
|
export declare function findMetadataEntry(didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc', id?: string, jsonSchemaRef?: string): any;
|
|
5
|
-
export declare function saveMetadataEntry(agent: VsAgent, didRecord: DidRecord, credential:
|
|
26
|
+
export declare function saveMetadataEntry(agent: VsAgent, didRecord: DidRecord, credential: TrustCredential, verifiablePresentation: TrustPresentation, didDocumentServiceId: string, key: '_vt/vtc' | '_vt/jsc'): Promise<void>;
|
|
6
27
|
export declare function deleteMetadataEntry(agent: VsAgent, id: string, didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc'): Promise<{
|
|
7
28
|
schemaId: any;
|
|
8
29
|
} | null>;
|
|
9
|
-
export declare function createVtc(agent: VsAgent, publicApiBaseUrl: string, id: string, credential:
|
|
30
|
+
export declare function createVtc(agent: VsAgent, publicApiBaseUrl: string, id: string, credential: TrustCredential): Promise<TrustPresentation>;
|
|
10
31
|
export interface CreateJscOptions {
|
|
11
32
|
schemaBaseId: string;
|
|
12
33
|
jsonSchemaRef: string;
|
|
13
34
|
precomputedDigestSRI?: string;
|
|
14
35
|
}
|
|
15
|
-
export declare function createJsc(agent: VsAgent, publicApiBaseUrl: string, ecsSchemas: Record<string, string>, options: CreateJscOptions): Promise<
|
|
36
|
+
export declare function createJsc(agent: VsAgent, publicApiBaseUrl: string, ecsSchemas: Record<string, string>, options: CreateJscOptions): Promise<W3cV2DataIntegritySecuredCredential & {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
16
39
|
export declare function removeTrustCredential(agent: VsAgent, schemaId: string, key: '_vt/jsc' | '_vt/vtc'): Promise<{
|
|
17
40
|
schemaId: any;
|
|
18
41
|
} | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Removes the linked VP and the stored credential an exchange delivered, as
|
|
44
|
+
* [VSA-VTI-FLOW-OP-REVOKE] requires of the applicant. The credential is read from the RFC 0809
|
|
45
|
+
* format data of the exchange; exchanges earlier versions completed over other formats are not
|
|
46
|
+
* migrated. Returns the credential id, or `undefined` when none is found, in which case nothing is
|
|
47
|
+
* removed.
|
|
48
|
+
*/
|
|
19
49
|
export declare function removeStoredTrustCredential(agent: VsAgent, credentialExchangeRecordId: string): Promise<string | undefined>;
|
|
20
50
|
export declare function migrateVtjscServiceIds(agent: VsAgent): Promise<void>;
|
|
21
51
|
/**
|