Interface SecpPubKey

All Superinterfaces:
AsymmetricKey, DEREncodablePREVIEW, ECKey, ECPublicKey, Key, PublicKey, Serializable
All Known Implementing Classes:
SecpPubKeyImpl

public interface SecpPubKey extends ECPublicKey
A valid secp256k1 Public Key that is a subclass of ECPublicKey
  • Method Details

    • getAlgorithm

      default String getAlgorithm()
      Return associated cryptographic algorithm. This implements the Key interface.
      Specified by:
      getAlgorithm in interface Key
      Returns:
      string indicating algorithm
    • getFormat

      default String getFormat()
      Return default encoding (serialization) format. This implements the Key interface.
      Specified by:
      getFormat in interface Key
      Returns:
      string indicating format
    • getEncoded

      default byte[] getEncoded()
      Return serialized key. This implements the Key interface and is an alias for serialize().
      Specified by:
      getEncoded in interface Key
      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

      default SecpPoint.Compressed getCompressed()
      Return as a compressed point
      Returns:
      compressed point
    • getUncompressed

      default SecpPoint.Uncompressed getUncompressed()
      Return as an uncompressed point
      Returns:
      uncompressed point
    • xOnly

      default SecpXOnlyPubKey xOnly()
      Return the x-only public key.
      Returns:
      x-only pubkey
    • getW

      ECPoint getW()
      Returns this key as a SecpECPoint or, if it is the "point at infinity" it returns ECPoint.POINT_INFINITY
      Specified by:
      getW in interface ECPublicKey
      Returns:
      point as ECPoint or subclass.
    • point

      Get the uncompressed SecpPoint
      Returns:
      point
    • getParams

      default ECParameterSpec getParams()
      Get the Elliptic Curve parameters
      Specified by:
      getParams in interface AsymmetricKey
      Specified by:
      getParams in interface ECKey
      Specified by:
      getParams in interface ECPublicKey
      Returns:
      the parameter spec
    • ofPoint

      static SecpPubKey ofPoint(ECPoint ecPoint)
      Construct a public key from an ECPoint
      Parameters:
      ecPoint - the point
      Returns:
      the pubkey
    • ofPoint

      static SecpPubKey ofPoint(SecpPoint.Uncompressed point)
      Construct a public key from an SecpPoint.Uncompressed
      Parameters:
      point - the point
      Returns:
      the pubkey