@tacoinfra/conseil-kms
Version:
Utilize AWS KMS Keys to work with ConseilJS.
23 lines • 940 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const conseiljs_1 = require("conseiljs");
const tezos_kms_1 = require("@tacoinfra/tezos-kms");
class KmsKeyStore {
constructor(publicKey, publicKeyHash) {
this.derivationPath = undefined;
this.publicKey = publicKey;
this.publicKeyHash = publicKeyHash;
this.curve = conseiljs_1.KeyStoreCurve.SECP256K1;
this.storeType = conseiljs_1.KeyStoreType.Hardware;
this.secretKey = 'NOT AVAILABLE';
this.seed = 'NOT AVAILABLE';
}
static async from(kmsKeyId, region) {
const kmsClient = new tezos_kms_1.TezosKmsClient(kmsKeyId, region);
const publicKey = await kmsClient.getPublicKey();
const publicKeyHash = await kmsClient.getPublicKeyHash();
return new KmsKeyStore(publicKey, publicKeyHash);
}
}
exports.default = KmsKeyStore;
//# sourceMappingURL=kms-key-store.js.map