UNPKG

@crpdo/key

Version:

Streamlines key generation, derivation, and management through its simple and intuitive API

39 lines (34 loc) 751 B
/** * BaseKey Class is a wrapper around a key object that allows accessing public and private keys. * @class */ class BaseKey { /** * Constructs a new BaseKey instance. * * @param {Object} key - An object representing a key with publicKey and privateKey properties. * @constructor */ constructor(key) { this.key = key } /** * Accessor method for the public key. * * @returns {string} The public key from the key object. * @public */ get publicKey() { return this.key.publicKey } /** * Accessor method for the private key. * * @returns {string} The private key from the key object. * @public */ get privateKey() { return this.key.privateKey } } module.exports = BaseKey