Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const signJWT = (payload) => {
return didJWT.createJWT(payload, {
signer: didJWT.SimpleSigner(privKey),
issuer: did
})
}
value: function getJWTSigner() {
return SimpleSigner(this.signingKey._hdkey._privateKey);
}
}, {
constructor({ did, address, privateKey, signer, networks, registry, ethrConfig } = {}) {
if (signer) {
this.signer = signer
} else if (privateKey) {
this.signer = SimpleSigner(privateKey)
}
if (did) {
this.did = did
} else if (address) {
if (isMNID(address)) {
this.did = `did:uport:${address}`
}
if (address.match('^0x[0-9a-fA-F]{40}$')) {
this.did = `did:ethr:${address}`
}
} else if (privateKey) {
const kp = secp256k1.keyFromPrivate(privateKey)
const address = toEthereumAddress(kp.getPublic('hex'))
this.did = `did:ethr:${address}`
}
getJWTSigner () {
return SimpleSigner(this.signingKey._hdkey._privateKey)
}
getJWTSigner () {
return SimpleSigner(this.signingKey.privateKey.slice(2))
}
const signAnonymousClaim = (claim: any): VerifiableClaim => {
return createJWT(claim, {
issuer: Config.uport.app.address,
signer: SimpleSigner(Config.uport.app.privateKey),
})
}
getJWTSigner (space) {
return SimpleSigner(this._getKeys(space).signingKey.privateKey.slice(2))
}