mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Remove obsolete method
This commit is contained in:
parent
6c331e5988
commit
373d6eedf6
1 changed files with 0 additions and 27 deletions
27
src/claim.js
27
src/claim.js
|
@ -17,7 +17,6 @@ const openpgp = require('openpgp')
|
|||
const validator = require('validator')
|
||||
const validUrl = require('valid-url')
|
||||
const mergeOptions = require('merge-options')
|
||||
const keys = require('./keys')
|
||||
const proofs = require('./proofs')
|
||||
const verifications = require('./verifications')
|
||||
const claimDefinitions = require('./claimDefinitions')
|
||||
|
@ -73,32 +72,6 @@ class Claim {
|
|||
VERIFIED: 'verified',
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an array of claim objects from an OpenPGP key's notations
|
||||
* @static
|
||||
* @async
|
||||
* @function
|
||||
* @param {Key} key - Public key
|
||||
* @returns {Claim}
|
||||
*/
|
||||
static async fromKey(key) {
|
||||
if (!(key instanceof openpgp.key.Key)) {
|
||||
throw new Error('Input is not an OpenPGP key')
|
||||
}
|
||||
const fingerprintFromKey = await keys.getFingerprint(key)
|
||||
const userData = await keys.getUserData(key)
|
||||
|
||||
let claims = []
|
||||
userData.forEach((user, i) => {
|
||||
let userClaims = []
|
||||
user.notations.forEach((notation, j) => {
|
||||
userClaims.push(new Claim(notation, fingerprintFromKey))
|
||||
})
|
||||
claims.push(userClaims)
|
||||
})
|
||||
return claims
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a claim object from a JSON object
|
||||
* @static
|
||||
|
|
Loading…
Reference in a new issue