How to use the did-jwt.SimpleSigner function in did-jwt

To help you get started, we’ve selected a few did-jwt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 3box / 3box-js / src / __mocks__ / 3ID.js View on Github external
const signJWT = (payload) => {
    return didJWT.createJWT(payload, {
      signer: didJWT.SimpleSigner(privKey),
      issuer: did
    })
  }
github 3box / muport-core-js / lib / keyring.js View on Github external
value: function getJWTSigner() {
      return SimpleSigner(this.signingKey._hdkey._privateKey);
    }
  }, {
github uport-project / uport-credentials / src / Credentials.js View on Github external
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}`
    }
github 3box / muport-core-js / src / keyring.js View on Github external
getJWTSigner () {
    return SimpleSigner(this.signingKey._hdkey._privateKey)
  }
github 3box / 3box-js / src / 3id / keyring.js View on Github external
getJWTSigner () {
    return SimpleSigner(this.signingKey.privateKey.slice(2))
  }
github gluon-project / gluon-rxp / src / Services / uPort / index.ts View on Github external
const signAnonymousClaim = (claim: any): VerifiableClaim => {
  return createJWT(claim, {
    issuer: Config.uport.app.address,
    signer: SimpleSigner(Config.uport.app.privateKey),
  })
}
github 3box / identity-wallet-js / src / keyring.js View on Github external
getJWTSigner (space) {
    return SimpleSigner(this._getKeys(space).signingKey.privateKey.slice(2))
  }

did-jwt

Library for Signing and Verifying JWTs that use DIDs as issuers and JWEs that use DIDs as recipients

Apache-2.0
Latest version published 9 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages