pkcs11js: Provides its own types (#15597)

This commit is contained in:
Andy
2017-04-17 08:55:26 -07:00
committed by GitHub
parent 99d4280c4e
commit bda9aa34d5
6 changed files with 11 additions and 1297 deletions

View File

@@ -264,6 +264,12 @@
"sourceRepoURL": "https://github.com/pixijs/pixi-spine",
"asOfVersion": "1.4.2"
},
{
"libraryName": "pkcs11js",
"typingsPackageName": "pkcs11js",
"sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js",
"asOfVersion": "1.0.4"
},
{
"libraryName": "poly2tri.js",
"typingsPackageName": "poly2tri",

View File

@@ -4,7 +4,6 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/// <reference types="pkcs11js" />
/**
* A simple layer for interacting with PKCS #11 / PKCS11 / CryptoKI for Node

View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"pkcs11js": "^1.0.8"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
import * as pkcs11js from "pkcs11js";
const libPath = "C:\\tmp\\rtpkcs11ecp.dll";
let pkcs11 = new pkcs11js.PKCS11();
pkcs11.load(libPath);
pkcs11.C_Initialize();
try {
// Getting info about PKCS11 Module
let module_info = pkcs11.C_GetInfo();
// Getting list of slots
let slots = pkcs11.C_GetSlotList(true);
let slot = slots[0];
// Getting info about slot
let slot_info = pkcs11.C_GetSlotInfo(slot);
// Getting info about token
let token_info = pkcs11.C_GetTokenInfo(slot);
// Getting info about Mechanism
let mechs = pkcs11.C_GetMechanismList(slot);
let mech_info = pkcs11.C_GetMechanismInfo(slot, mechs[0]);
let session = pkcs11.C_OpenSession(slot, pkcs11js.CKF_RW_SESSION | pkcs11js.CKF_SERIAL_SESSION);
// Getting info about Session
let info = pkcs11.C_GetSessionInfo(session);
pkcs11.C_Login(session, 1, "12345678");
/**
* Your app code here
*/
pkcs11.C_Logout(session);
pkcs11.C_CloseSession(session);
}
catch (e) {
console.error(e);
}
finally {
pkcs11.C_Finalize();
}

View File

@@ -1,22 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"pkcs11js-tests.ts"
]
}