Generate a new key pair
ED25519
Create a new ED25519 key pair used to sign transactions and queries on the Hedera network. The private key is kept confidential and is used to sign transactions that modify the state of an account, topic, token, smart contract, or file entity on the network. The public key can be shared with other users on the network.
Method
Type
Description
PrivateKey.generateED25519()
PrivateKey
Generates an Ed25519 private key
PrivateKey.generateED25519().getPublicKey()
PublicKey
Derive a public key from this Ed25519 private key
PrivateKey.generateED25519().publicKey()
PublicKey
Derive a public key from this Ed25519 private key
PrivateKey.generateED25519().publicKey().toAccountId(<shard>,<realm>)
long, long
Contruct an alias account ID from a alias public key address
[DEPRECATED]
PrivateKey.generate()
PrivateKey
Generates an Ed25519 private key
Sample Output:
ECDSA (secp256k1_)
Create a new ECDSA (secp256k1) key pair used to sign transactions and queries on a Hedera network. The private key is kept confidential and is used to sign transactions that modify the state of an account, topic, token, smart contract, or file entity on the network. The public key can be shared with other users on the network.
Method
Type
Description
PrivateKey.generateECDSA()
PrivateKey
Generates an ECSDA private key
PrivateKey.generateECDSA().getPublicKey()
PublicKey
Derive a public key from this ECDSA private key
PrivateKey.generateECDSA().publicKey()
PublicKey
Derive a public key from this ECDSA private key
PrivateKey.generateECDSA().publicKey().toAccountId(<shard>, <realm>)
long, long
Contructs an account ID from an account alias public key
Sample Output:
Last updated