Package org.starcoin.utils
Class SignatureUtils
- java.lang.Object
-
- org.starcoin.utils.SignatureUtils
-
public class SignatureUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringGAS_TOKEN_CODE_STC
-
Constructor Summary
Constructors Constructor Description SignatureUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RawUserTransactioncreateRawUserTransaction(Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)static SignedUserTransactioncreateSignedUserTransaction(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)static byte[]ed25519Sign(Ed25519PrivateKey privateKey, byte[] data)static booleaned25519Verify(Ed25519PublicKey publicKey, byte[] signingMessage, byte[] signature)static Ed25519PublicKeygetPublicKey(Ed25519PrivateKey privateKey)static StringgetTransactionHash(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)static booleanmultiEd25519Verify(MultiEd25519PublicKey publicKey, byte[] signingMessage, byte[] signature)static booleansignedMessageCheckAccount(SignedMessage signedMessage, ChainId chainId, AccountResource accountResource)static booleansignedMessageCheckSignature(SignedMessage signedMessage)static StringsignPersonalMessage(Ed25519PrivateKey privateKey, String message)static SignedUserTransactionsignTxn(Ed25519PrivateKey privateKey, RawUserTransaction rawUserTransaction)static Ed25519PrivateKeystrToPrivateKey(String privateKeyString)
-
-
-
Field Detail
-
GAS_TOKEN_CODE_STC
public static final String GAS_TOKEN_CODE_STC
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransactionHash
public static String getTransactionHash(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)
-
createSignedUserTransaction
public static SignedUserTransaction createSignedUserTransaction(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)
-
createRawUserTransaction
public static RawUserTransaction createRawUserTransaction(Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs)
-
signTxn
public static SignedUserTransaction signTxn(Ed25519PrivateKey privateKey, RawUserTransaction rawUserTransaction)
-
signPersonalMessage
public static String signPersonalMessage(Ed25519PrivateKey privateKey, String message)
-
signedMessageCheckAccount
public static boolean signedMessageCheckAccount(SignedMessage signedMessage, ChainId chainId, AccountResource accountResource) throws DeserializationError, SerializationError
-
signedMessageCheckSignature
public static boolean signedMessageCheckSignature(SignedMessage signedMessage) throws SerializationError, DeserializationError
-
getPublicKey
public static Ed25519PublicKey getPublicKey(Ed25519PrivateKey privateKey)
-
ed25519Sign
public static byte[] ed25519Sign(Ed25519PrivateKey privateKey, byte[] data)
-
ed25519Verify
public static boolean ed25519Verify(Ed25519PublicKey publicKey, byte[] signingMessage, byte[] signature)
-
multiEd25519Verify
public static boolean multiEd25519Verify(MultiEd25519PublicKey publicKey, byte[] signingMessage, byte[] signature)
-
strToPrivateKey
public static Ed25519PrivateKey strToPrivateKey(String privateKeyString)
-
-