Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
use getter
Browse files Browse the repository at this point in the history
  • Loading branch information
shamb0t committed Nov 26, 2019
1 parent f198546 commit 000997a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/identities.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ class Identities {
get signingKeystore () { return this._signingKeystore }

async sign (identity, data) {
const signingKey = await this._keystore.getKey(identity.id)
const signingKey = await this.keystore.getKey(identity.id)
if (!signingKey) {
throw new Error(`Private signing key not found from Keystore`)
}
const sig = await this._keystore.sign(signingKey, data)
const sig = await this.keystore.sign(signingKey, data)
return sig
}

async verify (signature, publicKey, data, verifier = 'v1') {
return this._keystore.verify(signature, publicKey, data, verifier)
return this.keystore.verify(signature, publicKey, data, verifier)
}

async createIdentity (options = {}) {
Expand All @@ -62,7 +62,7 @@ class Identities {
}

async signId (id) {
const keystore = this._keystore
const keystore = this.keystore
const key = await keystore.getKey(id) || await keystore.createKey(id)
const publicKey = keystore.getPublic(key)
const idSignature = await keystore.sign(key, id)
Expand Down

0 comments on commit 000997a

Please sign in to comment.