类 SignatureUtils
java.lang.Object
org.starcoin.utils.SignatureUtils
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明static byte[]
ed25519Sign(Ed25519PrivateKey privateKey, byte[] data)
static boolean
ed25519Verify(Ed25519PublicKey publicKey, byte[] signingMessage, byte[] signature)
static Ed25519PublicKey
getPublicKey(Ed25519PrivateKey privateKey)
static String
getTransactionHash(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs, String gasTokenCode)
Compute transaction hash locally.static String
getTransactionHash(SignedUserTransaction signedUserTransaction)
Compute transaction hash locally.static boolean
multiEd25519Verify(MultiEd25519PublicKey publicKey, byte[] signingMessage, byte[] signature)
static boolean
signedMessageCheckAccount(SignedMessage signedMessage, ChainId chainId, AccountResource accountResource)
static boolean
signedMessageCheckSignature(SignedMessage signedMessage)
static String
signPersonalBcsSerializedMessage(Ed25519PrivateKey privateKey, String serializedMessageHex)
Sign personal BCS serialized SigningMessage.static String
signPersonalMessage(Ed25519PrivateKey privateKey, String message)
Sign personal string message.static SignedUserTransaction
signTxn(Ed25519PrivateKey privateKey, RawUserTransaction rawUserTransaction)
static Ed25519PrivateKey
strToPrivateKey(String privateKeyString)
-
字段详细资料
-
GAS_TOKEN_CODE_STC
- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
SignatureUtils
public SignatureUtils()
-
-
方法详细资料
-
getTransactionHash
public static String getTransactionHash(Ed25519PrivateKey ed25519PrivateKey, Integer chainId, AccountAddress accountAddress, BigInteger accountSeqNumber, TransactionPayload payload, BigInteger gasPrice, BigInteger gasLimit, Long expirationTimestampSecs, String gasTokenCode)Compute transaction hash locally. -
getTransactionHash
public static String getTransactionHash(SignedUserTransaction signedUserTransaction) throws SerializationErrorCompute transaction hash locally. -
signTxn
public static SignedUserTransaction signTxn(Ed25519PrivateKey privateKey, RawUserTransaction rawUserTransaction) -
signPersonalBcsSerializedMessage
public static String signPersonalBcsSerializedMessage(Ed25519PrivateKey privateKey, String serializedMessageHex)Sign personal BCS serialized SigningMessage.- 参数:
privateKey
- Private keyserializedMessageHex
- BCS serialized SigningMessage hex.- 返回:
- Signature
-
signPersonalMessage
Sign personal string message.- 参数:
privateKey
- Private keymessage
- string message to be signed as UTF_8 bytes- 返回:
- Signature
-
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
-
ed25519Sign
-
ed25519Verify
public static boolean ed25519Verify(Ed25519PublicKey publicKey, byte[] signingMessage, byte[] signature) -
multiEd25519Verify
public static boolean multiEd25519Verify(MultiEd25519PublicKey publicKey, byte[] signingMessage, byte[] signature) -
strToPrivateKey
-