How to use the webcrypto-core.Base64Url function in webcrypto-core

To help you get started, we’ve selected a few webcrypto-core 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 PeculiarVentures / node-webcrypto-p11 / lib / crypto / aes.ts View on Github external
// Core
import * as webcrypto from "webcrypto-core";
const WebCryptoError = webcrypto.WebCryptoError;
const Base64Url = webcrypto.Base64Url;

import { IAlgorithm, ITemplate, KeyGenMechanism, KeyType, ObjectClass, SecretKey, Session } from "graphene-pk11";
import * as graphene from "graphene-pk11";

import { BaseCrypto } from "../base";
import { CryptoKey } from "../key";
import * as utils from "../utils";

export function create_template(session: Session, alg: AesKeyGenParams, extractable: boolean, keyUsages: string[]): ITemplate {

    const id = utils.GUID(session);
    return {
        token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
        sensitive: !!process.env.WEBCRYPTO_PKCS11_SENSITIVE,
        class: ObjectClass.SECRET_KEY,
        keyType: KeyType.AES,
github PeculiarVentures / node-webcrypto-p11 / lib / crypto / rsa.ts View on Github external
// Core
import * as webcrypto from "webcrypto-core";

const WebCryptoError = webcrypto.WebCryptoError;
const AlgorithmError = webcrypto.AlgorithmError;
const Base64Url = webcrypto.Base64Url;

import {
    IAlgorithm,
    ITemplate,
    KeyGenMechanism,
    KeyType,
    MechanismEnum,
    ObjectClass,
    PrivateKey,
    PublicKey,
    RsaMgf,
    Session,
} from "graphene-pk11";
import * as graphene from "graphene-pk11";

import { BaseCrypto } from "../base";
github PeculiarVentures / node-webcrypto-p11 / lib / crypto / ec.ts View on Github external
// Core
import * as webcrypto from "webcrypto-core";
const AlgorithmError = webcrypto.AlgorithmError;
const Base64Url = webcrypto.Base64Url;

import {
    EcKdf,
    IAlgorithm,
    INamedCurve,
    ITemplate,
    KeyGenMechanism,
    KeyType,
    NamedCurve,
    ObjectClass,
    Session,
} from "graphene-pk11";
import * as graphene from "graphene-pk11";
import * as aes from "./aes";

import { BaseCrypto } from "../base";
github PeculiarVentures / node-webcrypto-ossl / lib / crypto / pbkdf2.ts View on Github external
function b64_decode(b64url: string): Buffer {
    return Buffer.from(Core.Base64Url.decode(b64url));
}