java.lang.Object
com.hedera.hashgraph.sdk.Key
com.hedera.hashgraph.sdk.PublicKey
com.hedera.hashgraph.sdk.PublicKeyECDSA
Encapsulate the ECDSA public key.
-
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Key
ECDSA_SECP256K1_CURVE, ECDSA_SECP256K1_DOMAIN, ID_EC_PUBLIC_KEY, ID_ECDSA_SECP256K1, ID_ED25519 -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) com.google.protobuf.ByteStringGet the signature from a signature pair protobuf.(package private) static PublicKeyECDSAfromBytesInternal(byte[] publicKey) Create a key from a byte array representation.(package private) static PublicKeyECDSAfromSubjectKeyInfoInternal(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo) Create a key from a subject public key info object.inthashCode()booleanisECDSA()Is this an ECDSA key?booleanIs this an ED25519 key?byte[]toBytes()Create the byte array.byte[]Extract the DER represented as a byte array.byte[]Extract the raw byte representation.Converts the key to EVM address(package private) KeySerialize this key as a protobuf object(package private) SignaturePairtoSignaturePairProtobuf(byte[] signature) Serialize this key as a SignaturePair protobuf objectbooleanverify(byte[] message, byte[] signature) Verify a signature on a message with this public key.Methods inherited from class com.hedera.hashgraph.sdk.PublicKey
fromAliasBytes, fromBytes, fromBytesDER, fromBytesECDSA, fromBytesED25519, fromString, fromStringDER, fromStringECDSA, fromStringED25519, toAccountId, toString, toStringDER, toStringRaw, unusableKey, verifyTransactionMethods inherited from class com.hedera.hashgraph.sdk.Key
fromProtobufKey
-
Method Details
-
fromBytesInternal
Create a key from a byte array representation.- Parameters:
publicKey- the byte array representing the key- Returns:
- the new key
-
fromSubjectKeyInfoInternal
static PublicKeyECDSA fromSubjectKeyInfoInternal(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo) Create a key from a subject public key info object.- Parameters:
subjectPublicKeyInfo- the subject public key info object- Returns:
- the new public key
-
extractSignatureFromProtobuf
Description copied from class:PublicKeyGet the signature from a signature pair protobuf.- Specified by:
extractSignatureFromProtobufin classPublicKey- Parameters:
pair- the protobuf- Returns:
- the signature
-
verify
public boolean verify(byte[] message, byte[] signature) Description copied from class:PublicKeyVerify a signature on a message with this public key. -
toProtobufKey
Key toProtobufKey()Description copied from class:KeySerialize this key as a protobuf object- Specified by:
toProtobufKeyin classKey
-
toSignaturePairProtobuf
Description copied from class:PublicKeySerialize this key as a SignaturePair protobuf object- Specified by:
toSignaturePairProtobufin classPublicKey
-
toBytesDER
public byte[] toBytesDER()Description copied from class:PublicKeyExtract the DER represented as a byte array.- Specified by:
toBytesDERin classPublicKey- Returns:
- the DER represented as a byte array
-
toBytes
public byte[] toBytes()Description copied from class:KeyCreate the byte array. -
toBytesRaw
public byte[] toBytesRaw()Description copied from class:PublicKeyExtract the raw byte representation.- Specified by:
toBytesRawin classPublicKey- Returns:
- the raw byte representation
-
toEvmAddress
Description copied from class:PublicKeyConverts the key to EVM address- Specified by:
toEvmAddressin classPublicKey- Returns:
- the EVM address
-
equals
-
hashCode
public int hashCode() -
isED25519
public boolean isED25519()Description copied from class:PublicKeyIs this an ED25519 key? -
isECDSA
public boolean isECDSA()Description copied from class:PublicKeyIs this an ECDSA key?
-