Class SecpXOnlyPubKeyImpl
java.lang.Object
org.bitcoinj.secp.internal.SecpXOnlyPubKeyImpl
- All Implemented Interfaces:
Comparable<ByteArray>, ByteArray, SecpXOnlyPubKey
Simple implementation using {code @byte[]} as internal storage.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Get the bytes as an arraybooleangetX()Get X as aBigIntegerinthashCode()static SecpXOnlyPubKeyImplofVerifiedBytes(byte[] bytes) byte[]Serialize as a 32-byte, Big-endian byte array (no prefix byte)byte[]Serialize as SECG Compressed (i.e. an even value, prefixed with a 0x02 byte).toString()static byte[]xOnlyToSerializedCompressed(byte[] xOnly) Convert to SECG Compressed serialization (i.e. an even value, prefixed with a 0x02 byte).
-
Constructor Details
-
SecpXOnlyPubKeyImpl
-
-
Method Details
-
ofVerifiedBytes
-
xOnlyToSerializedCompressed
public static byte[] xOnlyToSerializedCompressed(byte[] xOnly) Convert to SECG Compressed serialization (i.e. an even value, prefixed with a 0x02 byte).- Parameters:
xOnly- 32-byte x-only public key- Returns:
- SECG Compressed (even) value (33-bytes)
-
getX
Description copied from interface:SecpXOnlyPubKeyGet X as aBigInteger- Specified by:
getXin interfaceSecpXOnlyPubKey- Returns:
- X as a
BigInteger
-
bytes
-
serialize
public byte[] serialize()Description copied from interface:SecpXOnlyPubKeySerialize as a 32-byte, Big-endian byte array (no prefix byte)- Specified by:
serializein interfaceSecpXOnlyPubKey- Returns:
- Big-endian, 32 bytes
-
serializeCompressed
public byte[] serializeCompressed()Description copied from interface:SecpXOnlyPubKeySerialize as SECG Compressed (i.e. an even value, prefixed with a 0x02 byte).- Specified by:
serializeCompressedin interfaceSecpXOnlyPubKey- Returns:
- SECG Compressed (even) value
-
equals
-
hashCode
-
toString
-