Package com.algorand.algosdk.crypto
Class LogicsigSignature
- java.lang.Object
-
- com.algorand.algosdk.crypto.LogicsigSignature
-
public class LogicsigSignature extends Object
Serializable logicsig class. LogicsigSignature is constructed from a program and optional arguments. Signature sig and MultisigSignature msig property are available for modification by its clients.LogicsigSignature cannot sign transactions in all cases. Instead, use LogicSigAccount as a safe, general purpose signing mechanism. Since LogicSig does not track the provided signature's public key, LogicSig cannot sign transactions when delegated to a non-multisig account _and_ the sender is not the delegating account.
-
-
Constructor Summary
Constructors Constructor Description LogicsigSignature()
Uninitialized object used for serializer to ignore default values.LogicsigSignature(byte[] logicsig)
Unsigned logicsig object.LogicsigSignature(byte[] logicsig, List<byte[]> args)
Unsigned logicsig object, and its arguments.LogicsigSignature(byte[] logic, List<byte[]> args, byte[] sig, MultisigSignature msig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
bytesToSign()
Return prefixed program as byte array that is ready to signboolean
equals(Object obj)
Address
toAddress()
Calculate escrow address from logic sig program NOTE: THIS RETURNS AN ESCROW ACCOUNT OF A LOGIC-SIG (FROM LOGIC ITSELF), IT WILL NOT RETURN THE DELEGATED ADDRESS OF THE LOGIC-SIG.boolean
verify(Address singleSigner)
Perform signature verification against the sender address
-
-
-
Field Detail
-
logic
public final byte[] logic
-
args
public final List<byte[]> args
-
sig
public Signature sig
-
msig
public MultisigSignature msig
-
-
Constructor Detail
-
LogicsigSignature
public LogicsigSignature(byte[] logic, List<byte[]> args, byte[] sig, MultisigSignature msig)
-
LogicsigSignature
public LogicsigSignature(byte[] logicsig)
Unsigned logicsig object.- Parameters:
logicsig
-
-
LogicsigSignature
public LogicsigSignature(byte[] logicsig, List<byte[]> args)
Unsigned logicsig object, and its arguments.- Parameters:
logicsig
-args
-
-
LogicsigSignature
public LogicsigSignature()
Uninitialized object used for serializer to ignore default values.
-
-
Method Detail
-
toAddress
public Address toAddress() throws NoSuchAlgorithmException
Calculate escrow address from logic sig program NOTE: THIS RETURNS AN ESCROW ACCOUNT OF A LOGIC-SIG (FROM LOGIC ITSELF), IT WILL NOT RETURN THE DELEGATED ADDRESS OF THE LOGIC-SIG.- Returns:
- Address
- Throws:
NoSuchAlgorithmException
-
bytesToSign
public byte[] bytesToSign()
Return prefixed program as byte array that is ready to sign- Returns:
- byte[]
-
verify
public boolean verify(Address singleSigner) throws NoSuchAlgorithmException
Perform signature verification against the sender address- Parameters:
singleSigner
- only used in the case of a delegated LogicSig whose delegating account is backed by a single private key- Returns:
- boolean
- Throws:
NoSuchAlgorithmException
-
-