Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

did-jwt-vc

Package Overview
Dependencies
Maintainers
8
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

did-jwt-vc - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/index.d.ts

@@ -8,2 +8,4 @@ import { VerifiableCredentialPayload, Issuer, PresentationPayload } from './types';

export declare function createPresentation(payload: PresentationPayload, issuer: Issuer): Promise<string>;
export declare function validateVerifiableCredentialAttributes(payload: VerifiableCredentialPayload): void;
export declare function validatePresentationAttributes(payload: PresentationPayload): void;
export declare function verifyCredential(vc: string, resolver: Resolvable): Promise<any>;

@@ -10,0 +12,0 @@ export declare function verifyPresentation(presentation: string, resolver: Resolvable): Promise<any>;

2

lib/index.js

@@ -1,2 +0,2 @@

var e=require("did-jwt"),r=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/,t="https://www.w3.org/2018/credentials/v1",n="VerifiableCredential";function i(e){if(!e.match(r))throw new TypeError('"'+e+'" is not a valid JWT format')}function o(e){if(!(Number.isInteger(e)&&e<1e11))throw new TypeError('"'+e+'" is not a unix timestamp in seconds')}function a(e){if(e.length<1||!e.includes(t))throw new TypeError('@context is missing default context "'+t+'"')}function c(e){if(e.length<1||!e.includes(n))throw new TypeError('type is missing default "'+n+'"')}function s(e){a(e.vc["@context"]),c(e.vc.type),function(r){if(0===Object.keys(e.vc.credentialSubject).length)throw new TypeError("credentialSubject must not be empty")}(),e.nbf&&o(e.nbf),e.exp&&o(e.exp)}function l(e){if(a(e.vp["@context"]),c(e.vp.type),e.vp.verifiableCredential.length<1)throw new TypeError("vp.verifiableCredential must not be empty");for(var r=0,t=e.vp.verifiableCredential;r<t.length;r+=1)i(t[r]);e.exp&&o(e.exp)}exports.verifyPresentation=function(r,t){try{return Promise.resolve(e.verifyJWT(r,{resolver:t})).then(function(e){return l(e.payload),e})}catch(e){return Promise.reject(e)}},exports.verifyCredential=function(r,i){try{return Promise.resolve(e.verifyJWT(r,{resolver:i})).then(function(e){var r;return(r=e.payload)instanceof Object&&r.sub&&r.iss&&r.claim&&r.iat&&(e.payload=function(e){var r=e.iat,i=e.nbf,o=e.vc,a=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===r.indexOf(n)&&(t[n]=e[n]);return t}(e,["iat","nbf","claim","vc"]),c=Object.assign({},a,{nbf:i||r,vc:{"@context":[t],type:[n],credentialSubject:e.claim}});return o&&(e.issVc=o),c}(e.payload)),s(e.payload),e})}catch(e){return Promise.reject(e)}},exports.createPresentation=function(r,t){try{return l(r),Promise.resolve(e.createJWT(r,{issuer:t.did,signer:t.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},exports.createVerifiableCredential=function(r,t){try{return s(r),Promise.resolve(e.createJWT(r,{issuer:t.did,signer:t.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}};
var e=require("did-jwt"),t=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/,r="https://www.w3.org/2018/credentials/v1",n="VerifiableCredential";function i(e){if(!e.match(t))throw new TypeError('"'+e+'" is not a valid JWT format')}function o(e){if(!(Number.isInteger(e)&&e<1e11))throw new TypeError('"'+e+'" is not a unix timestamp in seconds')}function a(e){if(e.length<1||!e.includes(r))throw new TypeError('@context is missing default context "'+r+'"')}function c(e){if(e.length<1||!e.includes(n))throw new TypeError('type is missing default "'+n+'"')}function s(e){a(e.vc["@context"]),c(e.vc.type),function(t){if(0===Object.keys(e.vc.credentialSubject).length)throw new TypeError("credentialSubject must not be empty")}(),e.nbf&&o(e.nbf),e.exp&&o(e.exp)}function l(e){if(a(e.vp["@context"]),c(e.vp.type),e.vp.verifiableCredential.length<1)throw new TypeError("vp.verifiableCredential must not be empty");for(var t=0,r=e.vp.verifiableCredential;t<r.length;t+=1)i(r[t]);e.exp&&o(e.exp)}exports.verifyPresentation=function(t,r){try{return Promise.resolve(e.verifyJWT(t,{resolver:r})).then(function(e){return l(e.payload),e})}catch(e){return Promise.reject(e)}},exports.verifyCredential=function(t,i){try{return Promise.resolve(e.verifyJWT(t,{resolver:i})).then(function(e){var t;return(t=e.payload)instanceof Object&&t.sub&&t.iss&&t.claim&&t.iat&&(e.payload=function(e){var t=e.iat,i=e.nbf,o=e.vc,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["iat","nbf","claim","vc"]),c=Object.assign({},a,{nbf:i||t,vc:{"@context":[r],type:[n],credentialSubject:e.claim}});return o&&(e.issVc=o),c}(e.payload)),s(e.payload),e})}catch(e){return Promise.reject(e)}},exports.createPresentation=function(t,r){try{return l(t),Promise.resolve(e.createJWT(t,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},exports.createVerifiableCredential=function(t,r){try{return s(t),Promise.resolve(e.createJWT(t,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},exports.validateVerifiableCredentialAttributes=s,exports.validatePresentationAttributes=l;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("did-jwt")):"function"==typeof define&&define.amd?define(["exports","did-jwt"],t):t(e.didJwtVc={},e.didJwt)}(this,function(e,t){var r=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/,n="https://www.w3.org/2018/credentials/v1",i="VerifiableCredential";function o(e){if(!e.match(r))throw new TypeError('"'+e+'" is not a valid JWT format')}function c(e){if(!(Number.isInteger(e)&&e<1e11))throw new TypeError('"'+e+'" is not a unix timestamp in seconds')}function a(e){if(e.length<1||!e.includes(n))throw new TypeError('@context is missing default context "'+n+'"')}function s(e){if(e.length<1||!e.includes(i))throw new TypeError('type is missing default "'+i+'"')}function f(e){a(e.vc["@context"]),s(e.vc.type),function(t){if(0===Object.keys(e.vc.credentialSubject).length)throw new TypeError("credentialSubject must not be empty")}(),e.nbf&&c(e.nbf),e.exp&&c(e.exp)}function u(e){if(a(e.vp["@context"]),s(e.vp.type),e.vp.verifiableCredential.length<1)throw new TypeError("vp.verifiableCredential must not be empty");for(var t=0,r=e.vp.verifiableCredential;t<r.length;t+=1)o(r[t]);e.exp&&c(e.exp)}e.verifyPresentation=function(e,r){try{return Promise.resolve(t.verifyJWT(e,{resolver:r})).then(function(e){return u(e.payload),e})}catch(e){return Promise.reject(e)}},e.verifyCredential=function(e,r){try{return Promise.resolve(t.verifyJWT(e,{resolver:r})).then(function(e){var t;return(t=e.payload)instanceof Object&&t.sub&&t.iss&&t.claim&&t.iat&&(e.payload=function(e){var t=e.iat,r=e.nbf,o=e.vc,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["iat","nbf","claim","vc"]),a=Object.assign({},c,{nbf:r||t,vc:{"@context":[n],type:[i],credentialSubject:e.claim}});return o&&(e.issVc=o),a}(e.payload)),f(e.payload),e})}catch(e){return Promise.reject(e)}},e.createPresentation=function(e,r){try{return u(e),Promise.resolve(t.createJWT(e,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},e.createVerifiableCredential=function(e,r){try{return f(e),Promise.resolve(t.createJWT(e,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("did-jwt")):"function"==typeof define&&define.amd?define(["exports","did-jwt"],t):t(e.didJwtVc={},e.didJwt)}(this,function(e,t){var r=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/,n="https://www.w3.org/2018/credentials/v1",i="VerifiableCredential";function o(e){if(!e.match(r))throw new TypeError('"'+e+'" is not a valid JWT format')}function a(e){if(!(Number.isInteger(e)&&e<1e11))throw new TypeError('"'+e+'" is not a unix timestamp in seconds')}function c(e){if(e.length<1||!e.includes(n))throw new TypeError('@context is missing default context "'+n+'"')}function s(e){if(e.length<1||!e.includes(i))throw new TypeError('type is missing default "'+i+'"')}function f(e){c(e.vc["@context"]),s(e.vc.type),function(t){if(0===Object.keys(e.vc.credentialSubject).length)throw new TypeError("credentialSubject must not be empty")}(),e.nbf&&a(e.nbf),e.exp&&a(e.exp)}function u(e){if(c(e.vp["@context"]),s(e.vp.type),e.vp.verifiableCredential.length<1)throw new TypeError("vp.verifiableCredential must not be empty");for(var t=0,r=e.vp.verifiableCredential;t<r.length;t+=1)o(r[t]);e.exp&&a(e.exp)}e.verifyPresentation=function(e,r){try{return Promise.resolve(t.verifyJWT(e,{resolver:r})).then(function(e){return u(e.payload),e})}catch(e){return Promise.reject(e)}},e.verifyCredential=function(e,r){try{return Promise.resolve(t.verifyJWT(e,{resolver:r})).then(function(e){var t;return(t=e.payload)instanceof Object&&t.sub&&t.iss&&t.claim&&t.iat&&(e.payload=function(e){var t=e.iat,r=e.nbf,o=e.vc,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["iat","nbf","claim","vc"]),c=Object.assign({},a,{nbf:r||t,vc:{"@context":[n],type:[i],credentialSubject:e.claim}});return o&&(e.issVc=o),c}(e.payload)),f(e.payload),e})}catch(e){return Promise.reject(e)}},e.createPresentation=function(e,r){try{return u(e),Promise.resolve(t.createJWT(e,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},e.createVerifiableCredential=function(e,r){try{return f(e),Promise.resolve(t.createJWT(e,{issuer:r.did,signer:r.signer,alg:"ES256K-R"}))}catch(e){return Promise.reject(e)}},e.validateVerifiableCredentialAttributes=f,e.validatePresentationAttributes=u});
//# sourceMappingURL=index.umd.js.map
{
"name": "did-jwt-vc",
"version": "0.1.1",
"version": "0.1.2",
"description": "Create and verify W3C Verifiable Credentials and Presentations in JWT format",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -5,6 +5,156 @@ # did-jwt-vc

## API
## Installation
`createVerifiableCredential()`
```
npm install did-jwt-vc
```
`createPresentation()`
## Usage
### Creating JWTs
#### Prerequisites
Create an `Issuer` object to sign JWTs using [ethr-did](https://github.com/uport-project/ethr-did):
```typescript
import EthrDID from 'ethr-did'
import { Issuer } from 'did-jwt-vc'
const issuer: Issuer = new EthrDID({
address: '0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
privateKey: 'd8b595680851765f38ea5405129244ba3cbad84467d190859f4c8b20c1ff6c75'
})
```
The `Issuer` object must contain a `did` attribute, as well as a `signer` function to generate the signature.
Currently, there is only support for `ethr-did` issuers to sign JWTs using the `ES256K-R` algorithm. Future versions of this library will enable support for alternative DID methods and signing algorithms.
#### Creating a Verifiable Credential
Specify a `payload` matching the `VerifiableCredentialPayload` interface. Create a JWT by signing it with the previously configured `issuer` using the `createVerifiableCredential` function:
```typescript
import { VerifiableCredentialPayload, createVerifiableCredential } from 'did-jwt-vc'
const vcPayload: VerifiableCredentialPayload = {
sub: 'did:ethr:0x435df3eda57154cf8cf7926079881f2912f54db4',
nbf: 1562950282,
vc: {
'@context': ['https://www.w3.org/2018/credentials/v1'],
type: ['VerifiableCredential'],
credentialSubject: {
degree: {
type: 'BachelorDegree',
name: 'Baccalauréat en musiques numériques'
}
}
}
}
const vcJwt = await createVerifiableCredential(vcPayload, issuer)
console.log(vcJwt)
// eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1Njk5NDg1NDUsInN1YiI6IjB4NDM1ZGYzZWRhNTcxNTRjZjhjZjc5MjYwNzk4ODFmMjkxMmY1NGRiNCIsIm5iZiI6MTU2Mjk1MDI4MiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsidHlwZSI6IkJhY2hlbG9yRGVncmVlIiwibmFtZSI6IkJhY2NhbGF1csOpYXQgZW4gbXVzaXF1ZXMgbnVtw6lyaXF1ZXMifX19LCJpc3MiOiJkaWQ6ZXRocjoweGYxMjMyZjg0MGYzYWQ3ZDIzZmNkYWE4NGQ2YzY2ZGFjMjRlZmIxOTgifQ.RynzSF4IqC85-DxRHwUyaagfxjDVV3_WnSl1sA2SYkYEvPLDrK6pgeXVkHCUDOdPiGlMuj2RDbt_yuIPtm1E7gE
```
#### Creating a Verifiable Presentation
Specify a `payload` matching the `PresentationPayload` interface, including the VC JWTs to be presented in the `vp.verifiableCredential` array. Create a JWT by signing it with the previously configured `issuer` using the `createPresentation` function:
```typescript
import { PresentationPayload, createPresentation } from 'did-jwt-vc'
const vpPayload: PresentationPayload = {
vp: {
'@context': ['https://www.w3.org/2018/credentials/v1'],
type: ['VerifiableCredential'],
verifiableCredential: [vcJwt]
}
}
const vpJwt = await createPresentation(vpPayload, issuer)
console.log(vpJwt)
// eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1Njk5NDg1NDUsInZwIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwidmVyaWZpYWJsZUNyZWRlbnRpYWwiOlsiZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKRlV6STFOa3N0VWlKOS5leUpwWVhRaU9qRTFOams1TkRnMU5EVXNJbk4xWWlJNklqQjRORE0xWkdZelpXUmhOVGN4TlRSalpqaGpaamM1TWpZd056azRPREZtTWpreE1tWTFOR1JpTkNJc0ltNWlaaUk2TVRVMk1qazFNREk0TWl3aWRtTWlPbnNpUUdOdmJuUmxlSFFpT2xzaWFIUjBjSE02THk5M2QzY3Vkek11YjNKbkx6SXdNVGd2WTNKbFpHVnVkR2xoYkhNdmRqRWlYU3dpZEhsd1pTSTZXeUpXWlhKcFptbGhZbXhsUTNKbFpHVnVkR2xoYkNKZExDSmpjbVZrWlc1MGFXRnNVM1ZpYW1WamRDSTZleUprWldkeVpXVWlPbnNpZEhsd1pTSTZJa0poWTJobGJHOXlSR1ZuY21WbElpd2libUZ0WlNJNklrSmhZMk5oYkdGMWNzT3BZWFFnWlc0Z2JYVnphWEYxWlhNZ2JuVnR3Nmx5YVhGMVpYTWlmWDE5TENKcGMzTWlPaUprYVdRNlpYUm9jam93ZUdZeE1qTXlaamcwTUdZellXUTNaREl6Wm1Oa1lXRTROR1EyWXpZMlpHRmpNalJsWm1JeE9UZ2lmUS5SeW56U0Y0SXFDODUtRHhSSHdVeWFhZ2Z4akRWVjNfV25TbDFzQTJTWWtZRXZQTERySzZwZ2VYVmtIQ1VET2RQaUdsTXVqMlJEYnRfeXVJUHRtMUU3Z0UiXX0sImlzcyI6ImRpZDpldGhyOjB4ZjEyMzJmODQwZjNhZDdkMjNmY2RhYTg0ZDZjNjZkYWMyNGVmYjE5OCJ9.dB0xmcMFhiIGVZByd7Zz7Ocy0DU4XaDhIo-aUoC35Nff2ZwM_Y6qlW5cKs51nuf2Ogs0aMGgQ422L1Tzjm_WrgE
```
### Verifying JWTs
#### Prerequisites
Create a `Resolver` using [did-resolver](https://github.com/decentralized-identity/did-resolver) and register the [ethr-did-resolver](https://github.com/decentralized-identity/ethr-did-resolver). When verifying a JWT signed by a DID, it is necessary to resolve its DID Document to check for keys that can validate the signature.
```typescript
import { Resolver } from 'did-resolver'
import { getResolver } from 'ethr-did-resolver'
const resolver = new Resolver(getResolver())
```
#### Verifying a Verifiable Credential
Pass in a VC JWT along with the resolver to verify using the `verifyCredential` function:
```typescript
import { verifyCredential } from 'did-jwt-vc'
const verifiedVC = await verifyCredential(vcJwt, resolver)
console.log(verifiedVC)
/*
{ payload:
{ iat: 1569948545,
sub: '0x435df3eda57154cf8cf7926079881f2912f54db4',
nbf: 1562950282,
vc:
{ '@context': [Array],
type: [Array],
credentialSubject: [Object] },
iss: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198' },
doc:
{ '@context': 'https://w3id.org/did/v1',
id: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
publicKey: [ [Object] ],
authentication: [ [Object] ] },
issuer: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
signer:
{ id: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198#owner',
type: 'Secp256k1VerificationKey2018',
owner: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
ethereumAddress: '0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198' },
jwt:
'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1Njk5NDg1NDUsInN1YiI6IjB4NDM1ZGYzZWRhNTcxNTRjZjhjZjc5MjYwNzk4ODFmMjkxMmY1NGRiNCIsIm5iZiI6MTU2Mjk1MDI4MiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsidHlwZSI6IkJhY2hlbG9yRGVncmVlIiwibmFtZSI6IkJhY2NhbGF1csOpYXQgZW4gbXVzaXF1ZXMgbnVtw6lyaXF1ZXMifX19LCJpc3MiOiJkaWQ6ZXRocjoweGYxMjMyZjg0MGYzYWQ3ZDIzZmNkYWE4NGQ2YzY2ZGFjMjRlZmIxOTgifQ.RynzSF4IqC85-DxRHwUyaagfxjDVV3_WnSl1sA2SYkYEvPLDrK6pgeXVkHCUDOdPiGlMuj2RDbt_yuIPtm1E7gE' }
*/
```
#### Verifying a Verifiable Presentation
Pass in a VP JWT along with the resolver to verify using the `verifyPresentation` function:
```typescript
import { verifyPresentation } from 'did-jwt-vc'
const verifiedVP = await verifyPresentation(vpJwt, resolver)
console.log(verifiedVP)
/*
{ payload:
{ iat: 1569948545,
vp:
{ '@context': [Array],
type: [Array],
verifiableCredential: [Array] },
iss: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198' },
doc:
{ '@context': 'https://w3id.org/did/v1',
id: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
publicKey: [ [Object] ],
authentication: [ [Object] ] },
issuer: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
signer:
{ id: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198#owner',
type: 'Secp256k1VerificationKey2018',
owner: 'did:ethr:0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198',
ethereumAddress: '0xf1232f840f3ad7d23fcdaa84d6c66dac24efb198' },
jwt:
'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1Njk5NDg1NDUsInZwIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwidmVyaWZpYWJsZUNyZWRlbnRpYWwiOlsiZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKRlV6STFOa3N0VWlKOS5leUpwWVhRaU9qRTFOams1TkRnMU5EVXNJbk4xWWlJNklqQjRORE0xWkdZelpXUmhOVGN4TlRSalpqaGpaamM1TWpZd056azRPREZtTWpreE1tWTFOR1JpTkNJc0ltNWlaaUk2TVRVMk1qazFNREk0TWl3aWRtTWlPbnNpUUdOdmJuUmxlSFFpT2xzaWFIUjBjSE02THk5M2QzY3Vkek11YjNKbkx6SXdNVGd2WTNKbFpHVnVkR2xoYkhNdmRqRWlYU3dpZEhsd1pTSTZXeUpXWlhKcFptbGhZbXhsUTNKbFpHVnVkR2xoYkNKZExDSmpjbVZrWlc1MGFXRnNVM1ZpYW1WamRDSTZleUprWldkeVpXVWlPbnNpZEhsd1pTSTZJa0poWTJobGJHOXlSR1ZuY21WbElpd2libUZ0WlNJNklrSmhZMk5oYkdGMWNzT3BZWFFnWlc0Z2JYVnphWEYxWlhNZ2JuVnR3Nmx5YVhGMVpYTWlmWDE5TENKcGMzTWlPaUprYVdRNlpYUm9jam93ZUdZeE1qTXlaamcwTUdZellXUTNaREl6Wm1Oa1lXRTROR1EyWXpZMlpHRmpNalJsWm1JeE9UZ2lmUS5SeW56U0Y0SXFDODUtRHhSSHdVeWFhZ2Z4akRWVjNfV25TbDFzQTJTWWtZRXZQTERySzZwZ2VYVmtIQ1VET2RQaUdsTXVqMlJEYnRfeXVJUHRtMUU3Z0UiXX0sImlzcyI6ImRpZDpldGhyOjB4ZjEyMzJmODQwZjNhZDdkMjNmY2RhYTg0ZDZjNjZkYWMyNGVmYjE5OCJ9.dB0xmcMFhiIGVZByd7Zz7Ocy0DU4XaDhIo-aUoC35Nff2ZwM_Y6qlW5cKs51nuf2Ogs0aMGgQ422L1Tzjm_WrgE' }
*/
```

@@ -39,3 +39,3 @@ import { createJWT, verifyJWT } from 'did-jwt'

function validateVerifiableCredentialAttributes(
export function validateVerifiableCredentialAttributes(
payload: VerifiableCredentialPayload

@@ -50,3 +50,3 @@ ): void {

function validatePresentationAttributes(payload: PresentationPayload): void {
export function validatePresentationAttributes(payload: PresentationPayload): void {
validators.validateContext(payload.vp['@context'])

@@ -53,0 +53,0 @@ validators.validateType(payload.vp.type)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc