mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #22379 from DefinitelyTyped/not-needed-graphene-pk11
graphene-pk11: Provides its own types
This commit is contained in:
@@ -384,6 +384,12 @@
|
||||
"sourceRepoURL": "https://github.com/mikedeboer/node-github",
|
||||
"asOfVersion": "7.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "graphene-pk11",
|
||||
"typingsPackageName": "graphene-pk11",
|
||||
"sourceRepoURL": "https://github.com/PeculiarVentures/graphene",
|
||||
"asOfVersion": "2.0.31"
|
||||
},
|
||||
{
|
||||
"libraryName": "gulp-typescript",
|
||||
"typingsPackageName": "gulp-typescript",
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
import * as graphene from "graphene-pk11";
|
||||
let Module = graphene.Module;
|
||||
|
||||
let lib = "/usr/local/lib/softhsm/libsofthsm2.so";
|
||||
|
||||
let mod = Module.load(lib, "SoftHSM");
|
||||
mod.initialize();
|
||||
|
||||
let slot = mod.getSlots(0);
|
||||
if (slot.flags & graphene.SlotFlag.TOKEN_PRESENT) {
|
||||
let session = slot.open();
|
||||
session.login("12345");
|
||||
|
||||
// generate EC key
|
||||
let keys = session.generateKeyPair(graphene.KeyGenMechanism.ECDSA, {
|
||||
keyType: graphene.KeyType.ECDSA,
|
||||
token: false,
|
||||
derive: true,
|
||||
paramsECDSA: graphene.NamedCurve.getByName("secp192r1").value
|
||||
}, {
|
||||
keyType: graphene.KeyType.ECDSA,
|
||||
token: false,
|
||||
derive: true
|
||||
});
|
||||
|
||||
// derive algorithm
|
||||
let alg = {
|
||||
name: "ECDH1_DERIVE",
|
||||
params: new graphene.EcdhParams(
|
||||
graphene.EcKdf.SHA1,
|
||||
null,
|
||||
keys.publicKey.getAttribute({ pointEC: null }).pointEC)
|
||||
};
|
||||
|
||||
// Template for derived key
|
||||
let template = {
|
||||
"class": graphene.ObjectClass.SECRET_KEY,
|
||||
"token": false,
|
||||
"keyType": graphene.KeyType.AES,
|
||||
"valueLen": 256 / 8,
|
||||
"encrypt": true,
|
||||
"decrypt": true
|
||||
};
|
||||
|
||||
// Key derivation
|
||||
let dKey = session.deriveKey(alg, keys.privateKey, template);
|
||||
console.log("Derived key handle:", dKey.handle);
|
||||
|
||||
session.logout();
|
||||
session.close();
|
||||
}
|
||||
else {
|
||||
console.error("Slot is not initialized");
|
||||
}
|
||||
|
||||
mod.finalize();
|
||||
Vendored
-2273
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"pkcs11js": "^1.0.8"
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"graphene-pk11-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user