Interface SecpPubKey
- All Superinterfaces:
AsymmetricKey, DEREncodablePREVIEW, ECKey, ECPublicKey, Key, PublicKey, Serializable
- All Known Implementing Classes:
SecpPubKeyImpl
A valid secp256k1 Public Key that is a subclass of
ECPublicKey-
Field Summary
Fields inherited from interface ECPublicKey
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturn associated cryptographic algorithm.default SecpPoint.CompressedReturn as a compressed pointdefault byte[]Return serialized key.default StringReturn default encoding (serialization) format.default ECParameterSpecGet the Elliptic Curve parametersdefault SecpPoint.UncompressedReturn as an uncompressed pointgetW()Returns this key as aSecpECPointor, if it is the "point at infinity" it returnsECPoint.POINT_INFINITYstatic SecpPubKeyConstruct a public key from anECPointstatic SecpPubKeyofPoint(SecpPoint.Uncompressed point) Construct a public key from anSecpPoint.Uncompressedpoint()Get the uncompressedSecpPointdefault byte[]Serialize key in primary encoded format (compressed)default byte[]serialize(boolean compressed) Return encoded key in either compressed or uncompressed SEC format.default SecpXOnlyPubKeyxOnly()Return the x-only public key.
-
Method Details
-
getAlgorithm
Return associated cryptographic algorithm. This implements theKeyinterface.- Specified by:
getAlgorithmin interfaceKey- Returns:
- string indicating algorithm
-
getFormat
-
getEncoded
default byte[] getEncoded()Return serialized key. This implements theKeyinterface and is an alias forserialize().- Specified by:
getEncodedin interfaceKey- Returns:
- public key in compressed format
-
serialize
default byte[] serialize()Serialize key in primary encoded format (compressed)- Returns:
- public key in compressed format
-
serialize
default byte[] serialize(boolean compressed) Return encoded key in either compressed or uncompressed SEC format.- Parameters:
compressed- Use compressed variant of format- Returns:
- public key in SEC format
-
getCompressed
-
getUncompressed
Return as an uncompressed point- Returns:
- uncompressed point
-
xOnly
-
getW
ECPoint getW()Returns this key as aSecpECPointor, if it is the "point at infinity" it returnsECPoint.POINT_INFINITY- Specified by:
getWin interfaceECPublicKey- Returns:
- point as
ECPointor subclass.
-
point
-
getParams
Get the Elliptic Curve parameters- Specified by:
getParamsin interfaceAsymmetricKey- Specified by:
getParamsin interfaceECKey- Specified by:
getParamsin interfaceECPublicKey- Returns:
- the parameter spec
-
ofPoint
Construct a public key from anECPoint- Parameters:
ecPoint- the point- Returns:
- the pubkey
-
ofPoint
Construct a public key from anSecpPoint.Uncompressed- Parameters:
point- the point- Returns:
- the pubkey
-