diff --git a/src/noise.ts b/src/noise.ts index 8f75087..746949f 100644 --- a/src/noise.ts +++ b/src/noise.ts @@ -49,7 +49,7 @@ export class Noise implements INoiseConnection { this.useNoisePipes = false; if (staticNoiseKey) { - const publicKey = Buffer.from(box.keyPair.fromSecretKey(staticNoiseKey)['publicKey']); + const publicKey = Buffer.from(box.keyPair.fromSecretKey(staticNoiseKey).publicKey); this.staticKeys = { privateKey: staticNoiseKey, publicKey, diff --git a/src/utils.ts b/src/utils.ts index 51426fa..751a9a5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -12,8 +12,8 @@ const NoiseHandshakePayloadProto = pb.NoiseHandshakePayload; export function generateKeypair(): KeyPair { const keyPair = box.keyPair(); - const publicKey = Buffer.from(keyPair['publicKey']); - const privateKey = Buffer.from(keyPair['secretKey']); + const publicKey = Buffer.from(keyPair.publicKey); + const privateKey = Buffer.from(keyPair.secretKey); return { publicKey,