How to use the graphene-pk11.Enums function in graphene-pk11

To help you get started, we’ve selected a few graphene-pk11 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 / ec.ts View on Github external
import * as graphene from "graphene-pk11";
let ECDSA = graphene.ECDSA;
let Enums = graphene.Enums;

import * as alg from "./alg";
import * as iwc from "./iwebcrypto";
import {CryptoKey} from "./key";

let ALG_NAME_ECDH = "ECDH";
let ALG_NAME_ECDSA = "ECDSA";

let HASH_ALGS = ["SHA-1", "SHA-224", "SHA-256", "SHA-384", "SHA-512"];

export class Ec extends alg.AlgorithmBase {
    static generateKey(session: graphene.Session, alg: IEcKeyGenParams, extractable: boolean, keyUsages: string[], label?: string): iwc.ICryptoKeyPair {
        this.checkAlgorithmIdentifier(alg);
        this.checkKeyGenParams(alg);

        let _namedCurve = "";
github PeculiarVentures / node-webcrypto-p11 / lib / rsa.ts View on Github external
import * as graphene from "graphene-pk11"
var RSA = graphene.RSA;
var Enums = graphene.Enums;

import * as alg from "./alg"
import * as iwc from "./iwebcrypto"
import {CryptoKey} from "./key"

let ALG_NAME_RSA_PKCS1 = "RSASSA-PKCS1-v1_5";
let ALG_NAME_RSA_PSS = "RSA-PSS";
let ALG_NAME_RSA_OAEP = "RSA-OAEP";

let HASH_ALGS = ["SHA-1", "SHA-224", "SHA-256", "SHA-384", "SHA-512"];

export class Rsa extends alg.AlgorithmBase {
	static ALGORITHM_NAME: string = "";
	static generateKey(session: graphene.Session, alg: any, extractable: boolean, keyUsages: string[], label?: string): iwc.ICryptoKeyPair {
		var size = alg.modulusLength;
		var exp = new Buffer(alg.publicExponent);