|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.bitcoin.core.ECKey.ECDSASignature
com.google.bitcoin.crypto.TransactionSignature
public class TransactionSignature
A TransactionSignature wraps an ECKey.ECDSASignature and adds methods for handling
the additional SIGHASH mode byte that is used.
| Field Summary | |
|---|---|
int |
sighashFlags
A byte that controls which parts of a transaction are signed. |
| Fields inherited from class com.google.bitcoin.core.ECKey.ECDSASignature |
|---|
r, s |
| Constructor Summary | |
|---|---|
TransactionSignature(BigInteger r,
BigInteger s)
Constructs a signature with the given components and SIGHASH_ALL. |
|
TransactionSignature(ECKey.ECDSASignature signature,
Transaction.SigHash mode,
boolean anyoneCanPay)
Constructs a transaction signature based on the ECDSA signature. |
|
| Method Summary | |
|---|---|
boolean |
anyoneCanPay()
|
static int |
calcSigHashValue(Transaction.SigHash mode,
boolean anyoneCanPay)
Calculates the byte used in the protocol to represent the combination of mode and anyoneCanPay. |
static TransactionSignature |
decodeFromBitcoin(byte[] bytes,
boolean requireCanonical)
Returns a decoded signature. |
static TransactionSignature |
dummy()
Returns a dummy invalid signature whose R/S values are set such that they will take up the same number of encoded bytes as a real signature. |
byte[] |
encodeToBitcoin()
What we get back from the signer are the two components of a signature, r and s. |
static boolean |
isEncodingCanonical(byte[] signature)
Returns true if the given signature is has canonical encoding, and will thus be accepted as standard by the reference client. |
void |
setSigHash(Transaction.SigHash mode,
boolean anyoneCanPay)
Configures the sighashFlags field as appropriate. |
Transaction.SigHash |
sigHashMode()
|
| Methods inherited from class com.google.bitcoin.core.ECKey.ECDSASignature |
|---|
decodeFromDER, derByteStream, encodeToDER, ensureCanonical |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int sighashFlags
| Constructor Detail |
|---|
public TransactionSignature(BigInteger r,
BigInteger s)
public TransactionSignature(ECKey.ECDSASignature signature,
Transaction.SigHash mode,
boolean anyoneCanPay)
| Method Detail |
|---|
public static TransactionSignature dummy()
public static int calcSigHashValue(Transaction.SigHash mode,
boolean anyoneCanPay)
public static boolean isEncodingCanonical(byte[] signature)
public void setSigHash(Transaction.SigHash mode,
boolean anyoneCanPay)
public boolean anyoneCanPay()
public Transaction.SigHash sigHashMode()
public byte[] encodeToBitcoin()
public static TransactionSignature decodeFromBitcoin(byte[] bytes,
boolean requireCanonical)
throws VerificationException
RuntimeException - if the signature is invalid or unparseable in some way.
VerificationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||