Constructor
new Handshake(challenge, publicKey, signature)
Parameters:
Name | Type | Description |
---|---|---|
challenge | buffer | Random bytes for challenge to sign |
publicKey | buffer | SECP256K1 public key |
signature | buffer | ECDSA signature of the challenge |
- Source
Methods
sign(privateKey) → {Handshake}
Signs the challenge
Parameters:
Name | Type | Description |
---|---|---|
privateKey | buffer | SECP256K1 private key |
- Source
Returns:
- Type:
- Handshake
toBuffer() → {buffer}
Serialize to a buffer
- Source
Returns:
- Type:
- buffer
verify() → {boolean}
Verifies the signature
- Source
Returns:
- Type:
- boolean
(static) challenge() → {buffer}
Generates a random 32 byte challenge
- Source
Returns:
- Type:
- buffer