2021-11-15 08:16:50 -07:00
|
|
|
const doip = require('../src')
|
|
|
|
|
|
|
|
const main = async () => {
|
2021-11-17 01:38:14 -07:00
|
|
|
// Fetch the key using HKP
|
|
|
|
const key = await doip.keys.fetchHKP("test@doip.rocks")
|
2021-11-15 08:16:50 -07:00
|
|
|
|
|
|
|
// Process it to extract the UIDs and their claims
|
|
|
|
const obj = await doip.keys.process(key)
|
|
|
|
|
2022-02-08 10:48:57 -07:00
|
|
|
// 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)
|
|
|
|
})
|
|
|
|
})
|
2021-11-15 08:16:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
main()
|