Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = "";
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);