How to use the jsrsasign.KJUR.crypto function in jsrsasign

To help you get started, we’ve selected a few jsrsasign 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 qzind / tray / assets / signing / sign-message.ts View on Github external
.then(data => {
     var pk = KEYUTIL.getKey(data);
     var sig = new KJUR.crypto.Signature({"alg": "SHA512withRSA"}); // Use "SHA1withRSA" for QZ Tray 2.0 and older
     sig.init(pk);
     sig.updateString(hash);
     var hex = sig.sign();
     console.log("DEBUG: \n\n" + stob64(hextorstr(hex)));
     resolve(stob64(hextorstr(hex)));
   })
   .catch(err => console.error(err));
github accordproject / concerto / packages / composer-common / lib / certificate.js View on Github external
constructor(pem) {
        const method = 'constructor';
        LOG.entry(method, pem);
        this.pem = pem;
        this.certificate = new X509();
        this.certificate.readCertPEM(pem);
        this.publicKey = KEYUTIL.getPEM(this.certificate.getPublicKey());
        this.identifier = KJUR.crypto.Util.hashHex(this.certificate.getPublicKey().pubKeyHex, 'sha256');
        this.issuer = KJUR.crypto.Util.hashHex(this.certificate.getIssuerString(), 'sha256');
        this.name = /(\/CN=)(.*?)(\/|,|$)/.exec(this.certificate.getSubjectString())[2];
        LOG.exit(method);
    }
github accordproject / concerto / packages / composer-common / lib / certificate.js View on Github external
constructor(pem) {
        const method = 'constructor';
        LOG.entry(method, pem);
        this.pem = pem;
        this.certificate = new X509();
        this.certificate.readCertPEM(pem);
        this.publicKey = KEYUTIL.getPEM(this.certificate.getPublicKey());
        this.identifier = KJUR.crypto.Util.hashHex(this.certificate.getPublicKey().pubKeyHex, 'sha256');
        this.issuer = KJUR.crypto.Util.hashHex(this.certificate.getIssuerString(), 'sha256');
        this.name = /(\/CN=)(.*?)(\/|,|$)/.exec(this.certificate.getSubjectString())[2];
        LOG.exit(method);
    }
github damienbod / AspNetCoreIdentityServer4Persistence / ClientOne / angularApp / app / auth / services / oidc.security.validation.ts View on Github external
private generate_at_hash(access_token: any): string {
        const hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
        const first128bits = hash.substr(0, hash.length / 2);
        const testdata = hextob64u(first128bits);

        return testdata;
    }
}
github damienbod / AspNet5IdentityServerAngularImplicitFlow / src / AngularClient / angularApp / app / auth / services / oidc.security.validation.ts View on Github external
private generate_at_hash(access_token: any): string {
        const hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
        const first128bits = hash.substr(0, hash.length / 2);
        const testdata = hextob64u(first128bits);

        return testdata;
    }
github IBM / cognos-dashboard-demo / src / app / services / encrypt.service.ts View on Github external
encryptValue(value) : string {
    var keyObj = KEYUTIL.getKey(this.key);//this.session.keys[0]);//sessionObj.keys[0]);
    var hex = KJUR.crypto.Cipher.encrypt(value, keyObj);

    return '{enc}' + hextob64(hex);
  }
github damienbod / AspNet5IdentityServerAngularImplicitFlow / src / AngularClientCode / angularApp / app / auth / services / oidc.security.validation.ts View on Github external
generate_code_verifier(code_challenge: any): string {
        const hash = KJUR.crypto.Util.hashString(code_challenge, 'sha256');
        const testdata = hextob64u(hash);

        return testdata;
    }
}
github damienbod / AspNet5IdentityServerAngularImplicitFlow / src / AngularClientCode / angularApp / app / auth / services / oidc.security.validation.ts View on Github external
private generate_at_hash(access_token: any): string {
        const hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
        const first128bits = hash.substr(0, hash.length / 2);
        const testdata = hextob64u(first128bits);

        return testdata;
    }

jsrsasign

opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK)

MIT
Latest version published 11 months ago

Package Health Score

74 / 100
Full package analysis