public class PrivateKeyAccount extends PublicKeyAccount
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static PrivateKeyAccount |
fromPrivateKey(String privateKey,
byte chainId) |
static PrivateKeyAccount |
fromSeed(String seed,
int nonce,
byte chainId) |
static String |
generateSeed()
Generates a 15-word random seed.
|
byte[] |
getPrivateKey() |
int |
hashCode() |
String |
sign(byte[] bytes) |
String |
sign(Transaction tx)
Signs a object and returns Base58-encoded signature.
|
getAddress, getChainId, getPublicKey
public static PrivateKeyAccount fromSeed(String seed, int nonce, byte chainId)
public static PrivateKeyAccount fromPrivateKey(String privateKey, byte chainId)
public final byte[] getPrivateKey()
public String sign(Transaction tx)
Example usage of this method in a multisig scenario where 3 signers are to sign a lease object:
PublicKeyAccount leaser = ...
PrivateKeyAccount signer = ...
Transaction tx = makeLeaseTx(leaser, recipient, amount, fee); // produces unsigned object
tx = tx.setProof(0, signer.sign(tx)); // sets the signature as proof 0
node.send(tx);
tx
- object to signpublic String sign(byte[] bytes)
public static String generateSeed()
public boolean equals(Object o)
equals
in class PublicKeyAccount
public int hashCode()
hashCode
in class PublicKeyAccount
Copyright © 2019. All rights reserved.