How to use the pkcs11js.CKM_ECDSA_KEY_PAIR_GEN function in pkcs11js

To help you get started, we’ve selected a few pkcs11js 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 / graphene / src / mech_enum.ts View on Github external
SKIPJACK_CFB16 = pkcs11.CKM_SKIPJACK_CFB16,
  SKIPJACK_CFB8 = pkcs11.CKM_SKIPJACK_CFB8,
  SKIPJACK_WRAP = pkcs11.CKM_SKIPJACK_WRAP,
  SKIPJACK_PRIVATE_WRAP = pkcs11.CKM_SKIPJACK_PRIVATE_WRAP,
  SKIPJACK_RELAYX = pkcs11.CKM_SKIPJACK_RELAYX,
  KEA_KEY_PAIR_GEN = pkcs11.CKM_KEA_KEY_PAIR_GEN,
  KEA_KEY_DERIVE = pkcs11.CKM_KEA_KEY_DERIVE,
  FORTEZZA_TIMESTAMP = pkcs11.CKM_FORTEZZA_TIMESTAMP,
  BATON_KEY_GEN = pkcs11.CKM_BATON_KEY_GEN,
  BATON_ECB128 = pkcs11.CKM_BATON_ECB128,
  BATON_ECB96 = pkcs11.CKM_BATON_ECB96,
  BATON_CBC128 = pkcs11.CKM_BATON_CBC128,
  BATON_COUNTER = pkcs11.CKM_BATON_COUNTER,
  BATON_SHUFFLE = pkcs11.CKM_BATON_SHUFFLE,
  BATON_WRAP = pkcs11.CKM_BATON_WRAP,
  ECDSA_KEY_PAIR_GEN = pkcs11.CKM_ECDSA_KEY_PAIR_GEN,
  EC_KEY_PAIR_GEN = pkcs11.CKM_EC_KEY_PAIR_GEN,

  ECDSA = pkcs11.CKM_ECDSA,
  ECDSA_SHA1 = pkcs11.CKM_ECDSA_SHA1,
  ECDSA_SHA224 = pkcs11.CKM_ECDSA_SHA224,
  ECDSA_SHA256 = pkcs11.CKM_ECDSA_SHA256,
  ECDSA_SHA384 = pkcs11.CKM_ECDSA_SHA384,
  ECDSA_SHA512 = pkcs11.CKM_ECDSA_SHA512,

  /* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE
	 * are new for v2.11 */
  ECDH1_DERIVE = pkcs11.CKM_ECDH1_DERIVE,
  ECDH1_COFACTOR_DERIVE = pkcs11.CKM_ECDH1_COFACTOR_DERIVE,
  ECMQV_DERIVE = pkcs11.CKM_ECMQV_DERIVE,

  JUNIPER_KEY_GEN = pkcs11.CKM_JUNIPER_KEY_GEN,
github PeculiarVentures / pvpkcs11 / test / ec.js View on Github external
it("#1", () => {
            const privateTemplate = [
                { type: pkcs11.CKA_ID, value: new Buffer("1234567890") },
                { type: pkcs11.CKA_SIGN, value: true },
                { type: pkcs11.CKA_DERIVE, value: true },
            ];
            const publicTemplate = [
                { type: pkcs11.CKA_ID, value: new Buffer("1234567890") },
                { type: pkcs11.CKA_EC_PARAMS, value: new Buffer("06082A8648CE3D030107", "hex") },
                { type: pkcs11.CKA_VERIFY, value: true },
                { type: pkcs11.CKA_DERIVE, value: true },
            ];

            const keys = mod.C_GenerateKeyPair(session, { mechanism: pkcs11.CKM_ECDSA_KEY_PAIR_GEN, parameter: null }, publicTemplate, privateTemplate);

            let attrs = mod.C_GetAttributeValue(session, keys.privateKey, [
                { type: pkcs11.CKA_TOKEN }
            ]);
        });
    });
github PeculiarVentures / pvpkcs11 / test / ec.js View on Github external
before(() => {
            const privateTemplate = [
                { type: pkcs11.CKA_ID, value: new Buffer("1234567890") },
                { type: pkcs11.CKA_SIGN, value: true },
            ];
            const publicTemplate = [
                { type: pkcs11.CKA_ID, value: new Buffer("1234567890") },
                { type: pkcs11.CKA_EC_PARAMS, value: new Buffer("06082A8648CE3D030107", "hex") },
                { type: pkcs11.CKA_VERIFY, value: true },
            ];

            const keys = mod.C_GenerateKeyPair(session, { mechanism: pkcs11.CKM_ECDSA_KEY_PAIR_GEN, parameter: null }, publicTemplate, privateTemplate);

            privateKey = keys.privateKey;
            publicKey = keys.publicKey;
        });
github PeculiarVentures / graphene / build / mech_enum.js View on Github external
MechanismEnum[MechanismEnum["SKIPJACK_CFB16"] = pkcs11.CKM_SKIPJACK_CFB16] = "SKIPJACK_CFB16";
    MechanismEnum[MechanismEnum["SKIPJACK_CFB8"] = pkcs11.CKM_SKIPJACK_CFB8] = "SKIPJACK_CFB8";
    MechanismEnum[MechanismEnum["SKIPJACK_WRAP"] = pkcs11.CKM_SKIPJACK_WRAP] = "SKIPJACK_WRAP";
    MechanismEnum[MechanismEnum["SKIPJACK_PRIVATE_WRAP"] = pkcs11.CKM_SKIPJACK_PRIVATE_WRAP] = "SKIPJACK_PRIVATE_WRAP";
    MechanismEnum[MechanismEnum["SKIPJACK_RELAYX"] = pkcs11.CKM_SKIPJACK_RELAYX] = "SKIPJACK_RELAYX";
    MechanismEnum[MechanismEnum["KEA_KEY_PAIR_GEN"] = pkcs11.CKM_KEA_KEY_PAIR_GEN] = "KEA_KEY_PAIR_GEN";
    MechanismEnum[MechanismEnum["KEA_KEY_DERIVE"] = pkcs11.CKM_KEA_KEY_DERIVE] = "KEA_KEY_DERIVE";
    MechanismEnum[MechanismEnum["FORTEZZA_TIMESTAMP"] = pkcs11.CKM_FORTEZZA_TIMESTAMP] = "FORTEZZA_TIMESTAMP";
    MechanismEnum[MechanismEnum["BATON_KEY_GEN"] = pkcs11.CKM_BATON_KEY_GEN] = "BATON_KEY_GEN";
    MechanismEnum[MechanismEnum["BATON_ECB128"] = pkcs11.CKM_BATON_ECB128] = "BATON_ECB128";
    MechanismEnum[MechanismEnum["BATON_ECB96"] = pkcs11.CKM_BATON_ECB96] = "BATON_ECB96";
    MechanismEnum[MechanismEnum["BATON_CBC128"] = pkcs11.CKM_BATON_CBC128] = "BATON_CBC128";
    MechanismEnum[MechanismEnum["BATON_COUNTER"] = pkcs11.CKM_BATON_COUNTER] = "BATON_COUNTER";
    MechanismEnum[MechanismEnum["BATON_SHUFFLE"] = pkcs11.CKM_BATON_SHUFFLE] = "BATON_SHUFFLE";
    MechanismEnum[MechanismEnum["BATON_WRAP"] = pkcs11.CKM_BATON_WRAP] = "BATON_WRAP";
    MechanismEnum[MechanismEnum["ECDSA_KEY_PAIR_GEN"] = pkcs11.CKM_ECDSA_KEY_PAIR_GEN] = "ECDSA_KEY_PAIR_GEN";
    MechanismEnum[MechanismEnum["EC_KEY_PAIR_GEN"] = pkcs11.CKM_EC_KEY_PAIR_GEN] = "EC_KEY_PAIR_GEN";
    MechanismEnum[MechanismEnum["ECDSA"] = pkcs11.CKM_ECDSA] = "ECDSA";
    MechanismEnum[MechanismEnum["ECDSA_SHA1"] = pkcs11.CKM_ECDSA_SHA1] = "ECDSA_SHA1";
    MechanismEnum[MechanismEnum["ECDSA_SHA224"] = pkcs11.CKM_ECDSA_SHA224] = "ECDSA_SHA224";
    MechanismEnum[MechanismEnum["ECDSA_SHA256"] = pkcs11.CKM_ECDSA_SHA256] = "ECDSA_SHA256";
    MechanismEnum[MechanismEnum["ECDSA_SHA384"] = pkcs11.CKM_ECDSA_SHA384] = "ECDSA_SHA384";
    MechanismEnum[MechanismEnum["ECDSA_SHA512"] = pkcs11.CKM_ECDSA_SHA512] = "ECDSA_SHA512";
    MechanismEnum[MechanismEnum["ECDH1_DERIVE"] = pkcs11.CKM_ECDH1_DERIVE] = "ECDH1_DERIVE";
    MechanismEnum[MechanismEnum["ECDH1_COFACTOR_DERIVE"] = pkcs11.CKM_ECDH1_COFACTOR_DERIVE] = "ECDH1_COFACTOR_DERIVE";
    MechanismEnum[MechanismEnum["ECMQV_DERIVE"] = pkcs11.CKM_ECMQV_DERIVE] = "ECMQV_DERIVE";
    MechanismEnum[MechanismEnum["JUNIPER_KEY_GEN"] = pkcs11.CKM_JUNIPER_KEY_GEN] = "JUNIPER_KEY_GEN";
    MechanismEnum[MechanismEnum["JUNIPER_ECB128"] = pkcs11.CKM_JUNIPER_ECB128] = "JUNIPER_ECB128";
    MechanismEnum[MechanismEnum["JUNIPER_CBC128"] = pkcs11.CKM_JUNIPER_CBC128] = "JUNIPER_CBC128";
    MechanismEnum[MechanismEnum["JUNIPER_COUNTER"] = pkcs11.CKM_JUNIPER_COUNTER] = "JUNIPER_COUNTER";
    MechanismEnum[MechanismEnum["JUNIPER_SHUFFLE"] = pkcs11.CKM_JUNIPER_SHUFFLE] = "JUNIPER_SHUFFLE";
    MechanismEnum[MechanismEnum["JUNIPER_WRAP"] = pkcs11.CKM_JUNIPER_WRAP] = "JUNIPER_WRAP";
github PeculiarVentures / graphene / src / objects / keys / key.ts View on Github external
SECURID = pkcs11.CKM_SECURID_KEY_GEN,
  ACTI = pkcs11.CKM_ACTI_KEY_GEN,
  CAST = pkcs11.CKM_CAST_KEY_GEN,
  CAST3 = pkcs11.CKM_CAST3_KEY_GEN,
  CAST5 = pkcs11.CKM_CAST5_KEY_GEN,
  CAST128 = pkcs11.CKM_CAST128_KEY_GEN,
  RC5 = pkcs11.CKM_RC5_KEY_GEN,
  IDEA = pkcs11.CKM_IDEA_KEY_GEN,
  GENERIC_SECRET = pkcs11.CKM_GENERIC_SECRET_KEY_GEN,
  SSL3_PRE_MASTER = pkcs11.CKM_SSL3_PRE_MASTER_KEY_GEN,
  CAMELLIA = pkcs11.CKM_CAMELLIA_KEY_GEN,
  ARIA = pkcs11.CKM_ARIA_KEY_GEN,
  SKIPJACK = pkcs11.CKM_SKIPJACK_KEY_GEN,
  KEA = pkcs11.CKM_KEA_KEY_PAIR_GEN,
  BATON = pkcs11.CKM_BATON_KEY_GEN,
  ECDSA = pkcs11.CKM_ECDSA_KEY_PAIR_GEN,
  EC = pkcs11.CKM_EC_KEY_PAIR_GEN,
  JUNIPER = pkcs11.CKM_JUNIPER_KEY_GEN,
  TWOFISH = pkcs11.CKM_TWOFISH_KEY_GEN,
}

/**
 * Definition for the base key object class
 * - defines the object class `CKO_PUBLIC_KEY`, `CKO_PRIVATE_KEY` and `CKO_SECRET_KEY` for type `CK_OBJECT_CLASS`
 * as used in the `CKA_CLASS` attribute of objects
 */
export class Key extends Storage {

  /**
   * Type of key
   * - Must be specified when object is created with `C_CreateObject`
   * - Must be specified when object is unwrapped with `C_UnwrapKey`
github PeculiarVentures / graphene / build / objects / keys / key.js View on Github external
KeyGenMechanism[KeyGenMechanism["SECURID"] = pkcs11.CKM_SECURID_KEY_GEN] = "SECURID";
    KeyGenMechanism[KeyGenMechanism["ACTI"] = pkcs11.CKM_ACTI_KEY_GEN] = "ACTI";
    KeyGenMechanism[KeyGenMechanism["CAST"] = pkcs11.CKM_CAST_KEY_GEN] = "CAST";
    KeyGenMechanism[KeyGenMechanism["CAST3"] = pkcs11.CKM_CAST3_KEY_GEN] = "CAST3";
    KeyGenMechanism[KeyGenMechanism["CAST5"] = pkcs11.CKM_CAST5_KEY_GEN] = "CAST5";
    KeyGenMechanism[KeyGenMechanism["CAST128"] = pkcs11.CKM_CAST128_KEY_GEN] = "CAST128";
    KeyGenMechanism[KeyGenMechanism["RC5"] = pkcs11.CKM_RC5_KEY_GEN] = "RC5";
    KeyGenMechanism[KeyGenMechanism["IDEA"] = pkcs11.CKM_IDEA_KEY_GEN] = "IDEA";
    KeyGenMechanism[KeyGenMechanism["GENERIC_SECRET"] = pkcs11.CKM_GENERIC_SECRET_KEY_GEN] = "GENERIC_SECRET";
    KeyGenMechanism[KeyGenMechanism["SSL3_PRE_MASTER"] = pkcs11.CKM_SSL3_PRE_MASTER_KEY_GEN] = "SSL3_PRE_MASTER";
    KeyGenMechanism[KeyGenMechanism["CAMELLIA"] = pkcs11.CKM_CAMELLIA_KEY_GEN] = "CAMELLIA";
    KeyGenMechanism[KeyGenMechanism["ARIA"] = pkcs11.CKM_ARIA_KEY_GEN] = "ARIA";
    KeyGenMechanism[KeyGenMechanism["SKIPJACK"] = pkcs11.CKM_SKIPJACK_KEY_GEN] = "SKIPJACK";
    KeyGenMechanism[KeyGenMechanism["KEA"] = pkcs11.CKM_KEA_KEY_PAIR_GEN] = "KEA";
    KeyGenMechanism[KeyGenMechanism["BATON"] = pkcs11.CKM_BATON_KEY_GEN] = "BATON";
    KeyGenMechanism[KeyGenMechanism["ECDSA"] = pkcs11.CKM_ECDSA_KEY_PAIR_GEN] = "ECDSA";
    KeyGenMechanism[KeyGenMechanism["EC"] = pkcs11.CKM_EC_KEY_PAIR_GEN] = "EC";
    KeyGenMechanism[KeyGenMechanism["JUNIPER"] = pkcs11.CKM_JUNIPER_KEY_GEN] = "JUNIPER";
    KeyGenMechanism[KeyGenMechanism["TWOFISH"] = pkcs11.CKM_TWOFISH_KEY_GEN] = "TWOFISH";
})(exports.KeyGenMechanism || (exports.KeyGenMechanism = {}));
var KeyGenMechanism = exports.KeyGenMechanism;