
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
@identity.com/verifiable-presentations
Advanced tools
Utility Library to securely handle verifiable presentations
Utility Library to securely handle verifiable presentations.
Verifiable-presentations provides methods to run operations over a collection of verifiable credentials and evidences, such as query for credential identifiers, search for claims, fetch claim values, and non-cryptographically and cryptographically secure verify the data against the proofs.
Usage example:
import { VerifiablePresentationManagerFactory } from '@identity.com/verifiable-presentations';
const secureRedundantManager = VerifiablePresentationManagerFactory.createSecureRedundantManager();
const artifacts = {
presentations: [
emailCredentialJson,
phoneNumberCredentialJson,
idDocumentCredentialJson
],
evidences: [
idDocumentEvidence
]
} as CredentialArtifacts;
let status = await secureRedundantManager.addCredentialArtifacts(artifacts);
status = await presentationManager.verifyAllArtifacts();
status = await presentationManager.purgeInvalidArtifacts();
const presentations = await secureRedundantManager.listPresentations();
const evidences = await secureRedundantManager.listEvidences();
let claims = await presentationManager.listClaims();
claims = await presentationManager.listPresentationClaims(presentations[0]);
const criteria = {
claimPath: 'contact.phoneNumber.countryCode'
}
claims = await presentationManager.findClaims(criteria);
const claimValue = await presentationManager.getClaimValue(claims[0]);
A class to allow easy extraction of PII from a DSR Response based on a specific dsrRequest implementation, with a given mapping and formatters specific to that DSR. It also allows generating a new Scope Request based on unique URL generation.
const mapping = {
first_name: { identifier: 'claim-cvc:Name.givenNames-v1' },
last_name: { identifier: 'claim-cvc:Name.familyNames-v1' },
date_of_birth: { identifier: 'claim-cvc:Document.dateOfBirth-v1' },
street: { identifier: 'claim-cvc:Identity.address-v1' },
};
const formatters = {
street: { format: claimValue => `${claimValue.street} ${claimValue.unit}` },
date_of_birth: { format: claimValue => `${claimValue.year}-${claimValue.month}-${claimValue.day}` },
};
const piiFactory = new PIIFactory(dsrRequest, mapping, formatters);
const eventsURL = 'https://testEvents';
const idvDid = 'did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a';
const dsrResolver = {
id: '123',
// key pair generated purely for this test
signingKeys: {
xpub: '0414a08b13afa8d33c499ec828065775915ddf0301634d35e26c6cec4ad0f0f2b72c79e90357d47c7ba65a3c03bb22ac7e273c5d01494448a155df8a28da33b48d',
xprv: 'a4947aa34ce507e995a60a455582d97f3fd1163eba3dd990ea1541a8fa049828',
},
};
const urlGeneratorFn = evidenceName => `https://<test cloud provider>/<unique Id>/${evidenceName}.json`;
// generate a DSR
const dsr = await piiFactory.generateDSR(eventsURL, idvDid, dsrResolver, urlGeneratorFn);
// extract PII from a DSR response
const extractedPII = await piiFactory.extractPII(dsrResponse);
For more detailed working examples, please, refer to the tests in index.test.ts.
FAQs
Utility Library to securely handle verifiable presentations
We found that @identity.com/verifiable-presentations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.