@llkennedy/padlock-api
Version:
HSM PKCS#11 GUI
199 lines • 9.14 kB
JavaScript
"use strict";
/**
* Code generated by mercury. DO NOT EDIT.
* versions:
* mercury v0.9.7
* protoc v3.10.1
* source: padlock.proto
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExposedPadlockClient = void 0;
const mercury = __importStar(require("@llkennedy/mercury"));
const protoc_gen_tsjson_1 = require("@llkennedy/protoc-gen-tsjson");
const padlock_1 = require("./padlock");
const pkcs11_1 = require("./pkcs11");
class ExposedPadlockClient extends mercury.Client {
constructor(basePath = "localhost/api/ExposedPadlock", useTLS = true, client = undefined) {
super(basePath, useTLS, client);
}
Hello(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("Hello", mercury.HTTPMethod.POST, req, padlock_1.AuthToken.Parse);
});
}
ApplicationListModules(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("ApplicationListModules", mercury.HTTPMethod.GET, req, padlock_1.ApplicationListModulesResponse.Parse);
});
}
ApplicationConnect(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.StartServerStream("ApplicationConnect", req, padlock_1.ApplicationConnectUpdate.Parse);
});
}
ModuleListSlots(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("ModuleListSlots", mercury.HTTPMethod.GET, req, padlock_1.ModuleListSlotsResponse.Parse);
});
}
ModuleInfo(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("ModuleInfo", mercury.HTTPMethod.GET, req, padlock_1.ModuleInfoResponse.Parse);
});
}
SlotListMechanisms(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SlotListMechanisms", mercury.HTTPMethod.GET, req, padlock_1.SlotListMechanismsResponse.Parse);
});
}
SlotInitToken(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SlotInitToken", mercury.HTTPMethod.POST, req, padlock_1.SlotInitTokenResponse.Parse);
});
}
SlotOpenSession(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.StartServerStream("SlotOpenSession", req, padlock_1.SlotOpenSessionUpdate.Parse);
});
}
SessionKeepAlive(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionKeepAlive", mercury.HTTPMethod.POST, req, protoc_gen_tsjson_1.google.protobuf.Empty.Parse);
});
}
SessionClose(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionClose", mercury.HTTPMethod.DELETE, req, padlock_1.SessionCloseResponse.Parse);
});
}
SessionLogin(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionLogin", mercury.HTTPMethod.PUT, req, padlock_1.SessionLoginResponse.Parse);
});
}
SessionLogout(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionLogout", mercury.HTTPMethod.PUT, req, padlock_1.SessionLogoutResponse.Parse);
});
}
SessionListObjects(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.StartServerStream("SessionListObjects", req, pkcs11_1.P11Object.Parse);
});
}
SessionCreateObject(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionCreateObject", mercury.HTTPMethod.POST, req, pkcs11_1.P11Object.Parse);
});
}
SessionGenerateRandom(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionGenerateRandom", mercury.HTTPMethod.POST, req, padlock_1.SessionGenerateRandomResponse.Parse);
});
}
SessionGenerateKeyPair(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionGenerateKeyPair", mercury.HTTPMethod.POST, req, padlock_1.SessionGenerateKeyPairResponse.Parse);
});
}
SessionGenerateKey(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("SessionGenerateKey", mercury.HTTPMethod.POST, req, pkcs11_1.P11Object.Parse);
});
}
ObjectListAttributeValues(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.StartServerStream("ObjectListAttributeValues", req, padlock_1.ObjectListAttributeValuesUpdate.Parse);
});
}
Encrypt(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("Encrypt", mercury.HTTPMethod.POST, req, padlock_1.ObjectEncryptResponse.Parse);
});
}
EncryptSegmented() {
return __awaiter(this, void 0, void 0, function* () {
return this.StartDualStream("EncryptSegmented", padlock_1.ObjectEncryptSegmentedResponse.Parse);
});
}
Decrypt(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("Decrypt", mercury.HTTPMethod.POST, req, padlock_1.ObjectDecryptResponse.Parse);
});
}
DecryptSegmented() {
return __awaiter(this, void 0, void 0, function* () {
return this.StartDualStream("DecryptSegmented", padlock_1.ObjectDecryptSegmentedResponse.Parse);
});
}
Sign(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("Sign", mercury.HTTPMethod.POST, req, padlock_1.ObjectSignResponse.Parse);
});
}
SignSegmented() {
return __awaiter(this, void 0, void 0, function* () {
return this.StartClientStream("SignSegmented", padlock_1.ObjectSignSegmentedResponse.Parse);
});
}
Verify(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("Verify", mercury.HTTPMethod.POST, req, padlock_1.ObjectVerifyResponse.Parse);
});
}
VerifySegmented() {
return __awaiter(this, void 0, void 0, function* () {
return this.StartClientStream("VerifySegmented", padlock_1.ObjectVerifySegmentedResponse.Parse);
});
}
WrapKey(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("WrapKey", mercury.HTTPMethod.PUT, req, padlock_1.ObjectWrapKeyResponse.Parse);
});
}
UnwrapKey(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("UnwrapKey", mercury.HTTPMethod.PUT, req, pkcs11_1.P11Object.Parse);
});
}
DestroyObject(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("DestroyObject", mercury.HTTPMethod.DELETE, req, padlock_1.ObjectDestroyObjectResponse.Parse);
});
}
CopyObject(req) {
return __awaiter(this, void 0, void 0, function* () {
return this.SendUnary("CopyObject", mercury.HTTPMethod.PUT, req, pkcs11_1.P11Object.Parse);
});
}
}
exports.ExposedPadlockClient = ExposedPadlockClient;
//# sourceMappingURL=padlock_mercury.js.map