How to use the graphene-pk11.NamedCurve.getByName 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
protected static getNamedCurve(name: string): INamedCurve {
        let namedCurve: string;
        switch (name) {
            case "P-192":
                namedCurve = "secp192r1";
                break;
            case "K-256":
                const p256 = NamedCurve.getByName("secp256r1");
                return {
                    name: "secp256k1",
                    oid: "1.3.132.0.10",
                    value: Buffer.from("06052b8104000A", "hex"),
                    size: p256.size,
                };
            case "P-256":
                namedCurve = "secp256r1";
                break;
            case "P-384":
                namedCurve = "secp384r1";
                break;
            case "P-521":
                namedCurve = "secp521r1";
                break;
            case "X25519":
github PeculiarVentures / node-webcrypto-p11 / lib / crypto / ec.ts View on Github external
case "P-256":
                namedCurve = "secp256r1";
                break;
            case "P-384":
                namedCurve = "secp384r1";
                break;
            case "P-521":
                namedCurve = "secp521r1";
                break;
            case "X25519":
                namedCurve = "curve25519";
                break;
            default:
                throw new Error(`Unsupported namedCurve in use ${name}`);
        }
        return NamedCurve.getByName(namedCurve);
    }