mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
Improve examples
This commit is contained in:
parent
6cd0307617
commit
498ad7bff0
2 changed files with 13 additions and 4 deletions
|
@ -7,8 +7,17 @@ const main = async () => {
|
|||
// Process it to extract the UIDs and their claims
|
||||
const obj = await doip.keys.process(key)
|
||||
|
||||
// Log the claims of the first UID
|
||||
console.log(obj.users[0].claims)
|
||||
// Process every claim for every user
|
||||
obj.users.forEach(async user => {
|
||||
user.claims.forEach(async claim => {
|
||||
// Match the claim
|
||||
await claim.match()
|
||||
|
||||
// Verify the claim
|
||||
await claim.verify()
|
||||
console.log(claim)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
main()
|
|
@ -5,10 +5,10 @@ const main = async () => {
|
|||
const claim = new doip.Claim("dns:doip.rocks", "3637202523e7c1309ab79e99ef2dc5827b445f4b")
|
||||
|
||||
// Match it to candidate service providers
|
||||
claim.match();
|
||||
claim.match()
|
||||
|
||||
// Verify the claim
|
||||
await claim.verify();
|
||||
await claim.verify()
|
||||
|
||||
// Log the claims of the first UID
|
||||
console.log(claim)
|
||||
|
|
Loading…
Reference in a new issue