Handshake

Create an validate a proxy authentication handshake

Constructor

new Handshake(challenge, publicKey, signature)

Parameters:
NameTypeDescription
challengebuffer

Random bytes for challenge to sign

publicKeybuffer

SECP256K1 public key

signaturebuffer

ECDSA signature of the challenge

Methods

sign(privateKey) → {Handshake}

Signs the challenge

Parameters:
NameTypeDescription
privateKeybuffer

SECP256K1 private key

Returns:
Type: 
Handshake

toBuffer() → {buffer}

Serialize to a buffer

Returns:
Type: 
buffer

verify() → {boolean}

Verifies the signature

Returns:
Type: 
boolean

(static) challenge() → {buffer}

Generates a random 32 byte challenge

Returns:
Type: 
buffer