How to use the jsrsasign.hextob64u 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 IdentityModel / oidc-client-js / sample / oidc.js View on Github external
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

var jsrsasign = require('jsrsasign');
var rsaKey = jsrsasign.KEYUTIL.generateKeypair("RSA", 1024);
var e = jsrsasign.hextob64u(rsaKey.pubKeyObj.e.toString(16));
var n = jsrsasign.hextob64u(rsaKey.pubKeyObj.n.toString(16));

var path = '/oidc';
var metadataPath = path + '/.well-known/openid-configuration';
var signingKeysPath = path + '/.well-known/jwks';
var authorizationPath = path + '/connect/authorize';
var userInfoPath = path + '/connect/userinfo';
var endSessionPath = path + '/connect/endsession';

var metadata = {
    issuer: path,
    jwks_uri: signingKeysPath,
    authorization_endpoint: authorizationPath,
    userinfo_endpoint: userInfoPath,
    end_session_endpoint: endSessionPath,
};
github IdentityModel / oidc-client-js / sample / oidc.js View on Github external
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

var jsrsasign = require('jsrsasign');
var rsaKey = jsrsasign.KEYUTIL.generateKeypair("RSA", 1024);
var e = jsrsasign.hextob64u(rsaKey.pubKeyObj.e.toString(16));
var n = jsrsasign.hextob64u(rsaKey.pubKeyObj.n.toString(16));

var path = '/oidc';
var metadataPath = path + '/.well-known/openid-configuration';
var signingKeysPath = path + '/.well-known/jwks';
var authorizationPath = path + '/connect/authorize';
var userInfoPath = path + '/connect/userinfo';
var endSessionPath = path + '/connect/endsession';

var metadata = {
    issuer: path,
    jwks_uri: signingKeysPath,
    authorization_endpoint: authorizationPath,
    userinfo_endpoint: userInfoPath,
    end_session_endpoint: endSessionPath,
};
github IdentityModel / oidc-client-js / sample / oidc.js View on Github external
function hashAccessToken(access_token) {
    var hash = jsrsasign.crypto.Util.hashString(access_token, "sha256")
    var left = hash.substr(0, hash.length / 2);
    var left_b64u = jsrsasign.hextob64u(left);
    return left_b64u;
}
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 / 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 / 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;
    }
github damienbod / AspNet5IdentityServerAngularImplicitFlow / src / AngularClientCode / angularApp / app / auth / services / oidc.security.validation.js View on Github external
OidcSecurityValidation.prototype.generate_at_hash = function (access_token) {
        var hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
        var first128bits = hash.substr(0, hash.length / 2);
        var testdata = hextob64u(first128bits);
        return testdata;
    };
    OidcSecurityValidation.prototype.generate_code_verifier = function (code_challenge) {

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 3 months ago

Package Health Score

75 / 100
Full package analysis