How to use the graphene-pk11.ObjectClass.PUBLIC_KEY 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 / crypto / ec.ts View on Github external
token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
            sensitive: !!process.env.WEBCRYPTO_PKCS11_SENSITIVE,
            class: ObjectClass.PRIVATE_KEY,
            keyType,
            private: true,
            label,
            id: idKey,
            extractable,
            derive: keyUsages.indexOf("deriveKey") !== -1 || keyUsages.indexOf("deriveBits") !== -1,
            sign: keyUsages.indexOf("sign") !== -1,
            decrypt: keyUsages.indexOf("decrypt") !== -1,
            unwrap: keyUsages.indexOf("unwrapKey") !== -1,
        },
        publicKey: {
            token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
            class: ObjectClass.PUBLIC_KEY,
            keyType,
            private: false,
            label,
            id: idKey,
            derive: keyUsages.indexOf("deriveKey") !== -1 || keyUsages.indexOf("deriveBits") !== -1,
            verify: keyUsages.indexOf("verify") !== -1,
            encrypt: keyUsages.indexOf("encrypt") !== -1,
            wrap: keyUsages.indexOf("wrapKey") !== -1,
        },
    };
}
github PeculiarVentures / node-webcrypto-p11 / src / key.ts View on Github external
constructor(key: Key, alg: T) {
    super();
    this.p11Object = key;
    switch (key.class) {
      case ObjectClass.PUBLIC_KEY:
        this.initPublicKey(key.toType());
        break;
      case ObjectClass.PRIVATE_KEY:
        this.initPrivateKey(key.toType());
        break;
      case ObjectClass.SECRET_KEY:
        this.initSecretKey(key.toType());
        break;
      default:
        throw new core.CryptoError(`Wrong incoming session object '${ObjectClass[key.class]}'`);
    }
    this.algorithm = alg;
    this.id = CryptoKey.getID(key);

    this.onAssign();
  }
github PeculiarVentures / node-webcrypto-p11 / src / mechs / rsa / crypto.ts View on Github external
token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
        sensitive: !!process.env.WEBCRYPTO_PKCS11_SENSITIVE,
        class: ObjectClass.PRIVATE_KEY,
        keyType: KeyType.RSA,
        private: true,
        label,
        id: idKey,
        extractable,
        derive: false,
        sign: keyUsages.indexOf("sign") > -1,
        decrypt: keyUsages.indexOf("decrypt") > -1,
        unwrap: keyUsages.indexOf("unwrapKey") > -1,
      },
      publicKey: {
        token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
        class: ObjectClass.PUBLIC_KEY,
        keyType: KeyType.RSA,
        private: false,
        label,
        id: idKey,
        verify: keyUsages.indexOf("verify") > -1,
        encrypt: keyUsages.indexOf("encrypt") > -1,
        wrap: keyUsages.indexOf("wrapKey") > -1,
      },
    };
  }
github PeculiarVentures / node-webcrypto-p11 / lib / crypto / rsa.ts View on Github external
token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
            sensitive: !!process.env.WEBCRYPTO_PKCS11_SENSITIVE,
            class: ObjectClass.PRIVATE_KEY,
            keyType: KeyType.RSA,
            private: true,
            label,
            id: idKey,
            extractable,
            derive: false,
            sign: keyUsages.indexOf("sign") > -1,
            decrypt: keyUsages.indexOf("decrypt") > -1,
            unwrap: keyUsages.indexOf("unwrapKey") > -1,
        },
        publicKey: {
            token: !!process.env.WEBCRYPTO_PKCS11_TOKEN,
            class: ObjectClass.PUBLIC_KEY,
            keyType: KeyType.RSA,
            private: false,
            label,
            id: idKey,
            verify: keyUsages.indexOf("verify") > -1,
            encrypt: keyUsages.indexOf("encrypt") > -1,
            wrap: keyUsages.indexOf("wrapKey") > -1,
        },
    };
}