| 程序包 | 说明 |
|---|---|
| network.nerve.core.crypto |
| 限定符和类型 | 字段和说明 |
|---|---|
static Sha256Hash |
Sha256Hash.ZERO_HASH |
| 限定符和类型 | 方法和说明 |
|---|---|
static Sha256Hash |
Sha256Hash.create(byte[] contents)
已过时。
|
static Sha256Hash |
Sha256Hash.createDouble(byte[] contents)
已过时。
|
static Sha256Hash |
Sha256Hash.of(byte[] contents)
Creates a new instance containing the calculated (one-time) hash of the given bytes.
|
static Sha256Hash |
Sha256Hash.of(File file)
Creates a new instance containing the calculated (one-time) hash of the given file's contents.
|
static Sha256Hash |
Sha256Hash.twiceOf(byte[] contents)
Creates a new instance containing the hash of the calculated hash of the given bytes.
|
static Sha256Hash |
Sha256Hash.wrap(byte[] rawHashBytes)
Creates a new instance that wraps the given hash value.
|
static Sha256Hash |
Sha256Hash.wrap(String hexString)
Creates a new instance that wraps the given hash value (represented as a hex string).
|
static Sha256Hash |
Sha256Hash.wrapReversed(byte[] rawHashBytes)
Creates a new instance that wraps the given hash value, but with byte order reversed.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
Sha256Hash.compareTo(Sha256Hash other) |
byte |
ECKey.findRecoveryId(Sha256Hash hash,
ECKey.ECDSASignature sig)
Returns the recovery ID, a byte with value between 0 and 3, inclusive, that specifies which of 4 possible
curve points was used to sign a message.
|
static ECKey |
ECKey.recoverFromSignature(int recId,
ECKey.ECDSASignature sig,
Sha256Hash message,
boolean compressed)
Given the components of a signature and a selector value, recover and return the public key
that generated the signature according to the algorithm in SEC1v2 section 4.1.6.
|
byte[] |
ECKey.sign(Sha256Hash hash)
用私钥对数据进行签名
|
boolean |
ECKey.verify(Sha256Hash sigHash,
ECKey.ECDSASignature signature)
Verifies the given R/S pair (signature) against a hash using the public key.
|
void |
ECKey.verifyOrThrow(Sha256Hash sigHash,
ECKey.ECDSASignature signature)
Verifies the given R/S pair (signature) against a hash using the public key, and throws an exception
if the signature doesn't match
|
Copyright © 2021. All rights reserved.