Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
docs: remove image binary
Browse files Browse the repository at this point in the history
- Part of #2433

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Jul 22, 2021
1 parent bdf24d3 commit 1b7a31d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 76 deletions.
Binary file removed docs/images/vcwallet-profiles.png
Binary file not shown.
153 changes: 77 additions & 76 deletions docs/vc_wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Refer [profile section](#creating-and-updating-wallet-profiles) for more details

Note: Each wallet profiles can have their own storage types (like leveldb, couchdb, EDV etc) and KMS (local or remote).

![Alt text](images/vcwallet-profiles.png "Wallet Profiles")
![image](https://user-images.githubusercontent.com/29631944/126654261-dc49eb29-5fa9-46cf-b189-b1773064e496.png)

* Storage - Agent creates new storage for each wallet profile during profile creation.
Storage type is typically same as agent's storage type, but a profile can also be created using already configured EDV if wallet user wish to use
Expand Down Expand Up @@ -558,82 +558,83 @@ Refer [Go Docs](https://github.com/hyperledger/aries-framework-go/blob/main/pkg/
Aries verifiable credential wallet is [available](https://github.com/hyperledger/aries-framework-go/blob/main/cmd/aries-js-worker/src/aries.js#L1080-L1273) as both Aries JavaScript WebAssembly and REST JS versions.
> Sample Aries JS wallet operations.
```
// create agent instance
let agent = new Agent.Framework(agentOpts)
// create profile
await agent.vcwallet.createProfile({userID, keyStoreURL, edvConfiguration})
// open wallet
let auth = await agent.vcwallet.open({userID, webKMSAuth, edvUnlocks, expiry})
// add content
await agent.vcwallet.add({userID, auth, contentType, collectionID, content})
// get content
let {content} = await agent.vcwallet.get({userID, auth, contentType, contentID})
// get all content
let {contents} = await agent.vcwallet.getAll({userID, auth, contentType})
// remove content
let {content} = await agent.vcwallet.remove({userID, auth, contentType, contentID})
// query by QueryByExample & QueryByFrame
let {results} = await agent.vcwallet.query({userID: this.user, auth, [{
"type": "QueryByFrame",
"credentialQuery": [{
"reason": "Please provide your Passport details.",
"frame": {
"@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/citizenship/v1", "https://w3id.org/security/bbs/v1"],
"type": ["VerifiableCredential", "PermanentResidentCard"],
"@explicit": true,
"identifier": {},
"issuer": {},
"issuanceDate": {},
"credentialSubject": {"@explicit": true, "name": {}, "spouse": {}}
},
"trustedIssuer": [{"issuer": "did:example:76e12ec712ebc6f1c221ebfeb1f", "required": true}],
"required": true
}]
}, {
"type": "QueryByExample",
"credentialQuery": [{
"reason": "Please present your valid degree certificate.",
"example": {
"@context": ["https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1"],
"type": ["UniversityDegreeCredential"],
"trustedIssuer": [
{"issuer": "urn:some:required:issuer"},
{
"required": true,
"issuer": "did:example:76e12ec712ebc6f1c221ebfeb1f"
}
],
"credentialSubject": {"id": "did:example:ebfeb1f712ebc6f1c276e12ec21"}
}
}]
}
]})
// issue credential
let vc = await agent.vcwallet.issue({userID, auth, credential, {controller}})
// verify credential
let verified = await agent.vcwallet.verify({userID auth, storedCredentialID, rawCredential, presentation})
// prove credential
let vp = await agent.vcwallet.prove({userID, auth, storedCredentials, rawCredentials, presentation, {controller}})
// derive credential
let derived = await agent.vcwallet.derive({userID, auth, storedCredentialID, rawCredential, deriveOption})
// create key pair
let vc = await agent.vcwallet.createKeyPair({userID, auth, keyType})
// close wallet
await agent.vcwallet.close({userID})
// create agent instance
let agent = new Agent.Framework(agentOpts)
// create profile
await agent.vcwallet.createProfile({userID, keyStoreURL, edvConfiguration})
// open wallet
let auth = await agent.vcwallet.open({userID, webKMSAuth, edvUnlocks, expiry})
// add content
await agent.vcwallet.add({userID, auth, contentType, collectionID, content})
// get content
let {content} = await agent.vcwallet.get({userID, auth, contentType, contentID})
// get all content
let {contents} = await agent.vcwallet.getAll({userID, auth, contentType})
// remove content
let {content} = await agent.vcwallet.remove({userID, auth, contentType, contentID})
// query by QueryByExample & QueryByFrame
let {results} = await agent.vcwallet.query({userID: this.user, auth, [{
"type": "QueryByFrame",
"credentialQuery": [{
"reason": "Please provide your Passport details.",
"frame": {
"@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/citizenship/v1", "https://w3id.org/security/bbs/v1"],
"type": ["VerifiableCredential", "PermanentResidentCard"],
"@explicit": true,
"identifier": {},
"issuer": {},
"issuanceDate": {},
"credentialSubject": {"@explicit": true, "name": {}, "spouse": {}}
},
"trustedIssuer": [{"issuer": "did:example:76e12ec712ebc6f1c221ebfeb1f", "required": true}],
"required": true
}]
}, {
"type": "QueryByExample",
"credentialQuery": [{
"reason": "Please present your valid degree certificate.",
"example": {
"@context": ["https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1"],
"type": ["UniversityDegreeCredential"],
"trustedIssuer": [
{"issuer": "urn:some:required:issuer"},
{
"required": true,
"issuer": "did:example:76e12ec712ebc6f1c221ebfeb1f"
}
],
"credentialSubject": {"id": "did:example:ebfeb1f712ebc6f1c276e12ec21"}
}
}]
}
]})
// issue credential
let vc = await agent.vcwallet.issue({userID, auth, credential, {controller}})
// verify credential
let verified = await agent.vcwallet.verify({userID auth, storedCredentialID, rawCredential, presentation})
// prove credential
let vp = await agent.vcwallet.prove({userID, auth, storedCredentials, rawCredentials, presentation, {controller}})
// derive credential
let derived = await agent.vcwallet.derive({userID, auth, storedCredentialID, rawCredential, deriveOption})
// create key pair
let vc = await agent.vcwallet.createKeyPair({userID, auth, keyType})
// close wallet
await agent.vcwallet.close({userID})
```

Expand Down

0 comments on commit 1b7a31d

Please sign in to comment.