public class ECDSASignature
extends java.lang.Object
Transaction signing logic.
Adapted from the BitcoinJ ECKey implementation.
| Constructor and Description |
|---|
ECDSASignature(byte[] privateKey) |
| Modifier and Type | Method and Description |
|---|---|
byte |
findRecoveryId(java.math.BigInteger[] sig,
byte[] message)
Returns the recovery ID, a byte with value between 0 and 3, inclusive, that specifies which of 4 possible
curve points were used to sign a message.
|
java.math.BigInteger[] |
generateSignature(byte[] message)
generate a signature for the given message using the key we were initialised with
|
static java.math.BigInteger |
publicFromPoint(byte[] bits)
Returns public key point from the given curve.
|
static java.math.BigInteger |
publicKeyFromPrivate(java.math.BigInteger privKey)
Returns public key from the given private key.
|
static org.bouncycastle.math.ec.ECPoint |
publicPointFromPrivate(java.math.BigInteger privKey)
Returns public key point from the given private key.
|
byte[] |
recoverableSerialize(java.math.BigInteger[] sig,
byte[] message)
Serialize the result of `generateSignature` and recovery id
|
public byte[] recoverableSerialize(java.math.BigInteger[] sig,
byte[] message)
sig - the R and S components of the signature, wrapped.message - Hash of the data that was signed.public java.math.BigInteger[] generateSignature(byte[] message)
message - Hash of the data that was signed.public byte findRecoveryId(java.math.BigInteger[] sig,
byte[] message)
sig - the R and S components of the signature, wrapped.message - Hash of the data that was signed.java.lang.RuntimeException - if no recovery ID can be found.public static java.math.BigInteger publicKeyFromPrivate(java.math.BigInteger privKey)
privKey - the private key to derive the public key frompublic static org.bouncycastle.math.ec.ECPoint publicPointFromPrivate(java.math.BigInteger privKey)
privKey - the private key to derive the public key frompublic static java.math.BigInteger publicFromPoint(byte[] bits)
bits - representing the point on the curve