Remove obsolete method

This commit is contained in:
Yarmo Mackenbach 2021-04-19 11:07:18 +02:00
parent 6c331e5988
commit 373d6eedf6
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -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