Class PublicKeyED25519


class PublicKeyED25519 extends PublicKey
Encapsulate the ED25519 public key.
  • Method Details

    • fromBytesInternal

      static PublicKeyED25519 fromBytesInternal(byte[] publicKey)
      Create a key from a byte array representation.
      Parameters:
      publicKey - the byte array representing the key
      Returns:
      the new key
    • fromSubjectKeyInfoInternal

      static PublicKeyED25519 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

      com.google.protobuf.ByteString extractSignatureFromProtobuf(SignaturePair pair)
      Description copied from class: PublicKey
      Get the signature from a signature pair protobuf.
      Specified by:
      extractSignatureFromProtobuf in class PublicKey
      Parameters:
      pair - the protobuf
      Returns:
      the signature
    • verify

      public boolean verify(byte[] message, byte[] signature)
      Description copied from class: PublicKey
      Verify a signature on a message with this public key.
      Specified by:
      verify in class PublicKey
      Parameters:
      message - The array of bytes representing the message
      signature - The array of bytes representing the signature
      Returns:
      boolean
    • toProtobufKey

      Key toProtobufKey()
      Description copied from class: Key
      Serialize this key as a protobuf object
      Specified by:
      toProtobufKey in class Key
    • toSignaturePairProtobuf

      SignaturePair toSignaturePairProtobuf(byte[] signature)
      Description copied from class: PublicKey
      Serialize this key as a SignaturePair protobuf object
      Specified by:
      toSignaturePairProtobuf in class PublicKey
    • toBytesDER

      public byte[] toBytesDER()
      Description copied from class: PublicKey
      Extract the DER represented as a byte array.
      Specified by:
      toBytesDER in class PublicKey
      Returns:
      the DER represented as a byte array
    • toBytes

      public byte[] toBytes()
      Description copied from class: Key
      Create the byte array.
      Specified by:
      toBytes in class PublicKey
      Returns:
      the byte array representation
    • toBytesRaw

      public byte[] toBytesRaw()
      Description copied from class: PublicKey
      Extract the raw byte representation.
      Specified by:
      toBytesRaw in class PublicKey
      Returns:
      the raw byte representation
    • toEvmAddress

      public EvmAddress toEvmAddress()
      Description copied from class: PublicKey
      Converts the key to EVM address
      Specified by:
      toEvmAddress in class PublicKey
      Returns:
      the EVM address
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isED25519

      public boolean isED25519()
      Description copied from class: PublicKey
      Is this an ED25519 key?
      Specified by:
      isED25519 in class PublicKey
      Returns:
      is this an ED25519 key
    • isECDSA

      public boolean isECDSA()
      Description copied from class: PublicKey
      Is this an ECDSA key?
      Specified by:
      isECDSA in class PublicKey
      Returns:
      is this an ECDSA key