This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow the use of publicKeyJwk to derive and verify proof (#145)
- Loading branch information
1 parent
3000f3c
commit 0cec1f1
Showing
15 changed files
with
338 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"@context": { | ||
"privateKeyJwk": { | ||
"@id": "https://w3id.org/security#privateKeyJwk", | ||
"@type": "@json" | ||
}, | ||
"JsonWebKey2020": { | ||
"@id": "https://w3id.org/security#JsonWebKey2020", | ||
"@context": { | ||
"@protected": true, | ||
"id": "@id", | ||
"type": "@type", | ||
"publicKeyJwk": { | ||
"@id": "https://w3id.org/security#publicKeyJwk", | ||
"@type": "@json" | ||
} | ||
} | ||
}, | ||
"JsonWebSignature2020": { | ||
"@id": "https://w3id.org/security#JsonWebSignature2020", | ||
"@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" | ||
}, | ||
"jws": "https://w3id.org/security#jws", | ||
"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" | ||
} | ||
} | ||
}, | ||
"verificationMethod": { | ||
"@id": "https://w3id.org/security#verificationMethod", | ||
"@type": "@id" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": "https://w3id.org/security/v2", | ||
"id": "did:example:82612387612873", | ||
"assertionMethod": ["did:example:82612387612873#test"] | ||
} |
14 changes: 14 additions & 0 deletions
14
__tests__/__fixtures__/data/did_example_82612387612873_test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"@context": [ | ||
"https://w3id.org/security/v2", | ||
"https://w3id.org/security/suites/jws-2020/v1" | ||
], | ||
"id": "did:example:82612387612873#test", | ||
"type": "JsonWebKey2020", | ||
"controller": "did:example:82612387612873", | ||
"publicKeyJwk": { | ||
"kty": "OKP", | ||
"crv": "Bls12381G2", | ||
"x": "h_rkcTKXXzRbOPr9UxSfegCbid2U_cVNXQUaKeGF7UhwrMJFP70uMH0VQ9-3-_2zDPAAjflsdeLkOXW3-ShktLxuPy8UlXSNgKNmkfb-rrj-FRwbs13pv_WsIf-eV66-" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://w3id.org/citizenship/v1", | ||
"https://w3id.org/security/v3-unstable" | ||
], | ||
"id": "https://issuer.oidp.uscis.gov/credentials/83627465", | ||
"type": ["VerifiableCredential", "PermanentResidentCard"], | ||
"issuer": "did:example:82612387612873", | ||
"identifier": "83627465", | ||
"name": "Permanent Resident Card", | ||
"description": "Government of Example Permanent Resident Card.", | ||
"issuanceDate": "2019-12-03T12:19:52Z", | ||
"expirationDate": "2029-12-03T12:19:52Z", | ||
"credentialSubject": { | ||
"id": "did:example:b34ca6cd37bbf23", | ||
"type": ["PermanentResident", "Person"], | ||
"givenName": "JOHN", | ||
"familyName": "SMITH", | ||
"gender": "Male", | ||
"image": "data:image/png;base64,iVBORw0KGgokJggg==", | ||
"residentSince": "2015-01-01", | ||
"lprCategory": "C09", | ||
"lprNumber": "999-999-999", | ||
"commuterClassification": "C1", | ||
"birthCountry": "Bahamas", | ||
"birthDate": "1958-07-17" | ||
}, | ||
"proof": { | ||
"type": "BbsBlsSignature2020", | ||
"created": "2021-08-05T03:19:13Z", | ||
"proofPurpose": "assertionMethod", | ||
"proofValue": "t7+Py6v7sYXMGQR6Mxgf9SyEb0NnckqOSM9xMz4WAT1A6uVV0L+Kk8ClUoyWqBsTC7OxzJAbkUx05V2ZXY3EUnZFWmPjgl5/lVsGd/iSJrAauewJgcXPJTQOp8paallZkw9rY3vuwjJ75jtEwPRxGA==", | ||
"verificationMethod": "did:example:82612387612873#test" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
__tests__/__fixtures__/data/test_vc_reveal_document_jwk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://w3id.org/citizenship/v1", | ||
"https://w3id.org/security/v3-unstable" | ||
], | ||
"id": "https://issuer.oidp.uscis.gov/credentials/83627465", | ||
"type": ["VerifiableCredential", "PermanentResidentCard"], | ||
"@explicit": true, | ||
"issuer": "did:example:489398593", | ||
"identifier": "83627465", | ||
"name": "Permanent Resident Card", | ||
"description": "Government of Example Permanent Resident Card.", | ||
"issuanceDate": "2019-12-03T12:19:52Z", | ||
"expirationDate": "2029-12-03T12:19:52Z", | ||
"credentialSubject": { | ||
"id": "did:example:b34ca6cd37bbf23", | ||
"type": ["PermanentResident", "Person"], | ||
"@explicit": true, | ||
"givenName": "JOHN", | ||
"familyName": "SMITH", | ||
"gender": "Male" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.