Class WrappedSignedProperty

java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedSignedProperty

public class WrappedSignedProperty extends AbstractWrapper
Represents a wrapper over a signed property.
  • Constructor Details

    • WrappedSignedProperty

      public WrappedSignedProperty(String name, String value, String signature)
      Construct a new wrapped signed property from the given values.
      Parameters:
      name - - the name of the property.
      value - - the value of the property.
      signature - - the BASE64-encoded signature of the value.
  • Method Details

    • fromHandle

      public static WrappedSignedProperty fromHandle(Object handle)
      Construct a new signed property from a given NMS property.
      Parameters:
      handle - - the property.
      Returns:
      The wrapped signed property.
    • fromValues

      public static WrappedSignedProperty fromValues(String name, String value, String signature)
      Construct a new wrapped signed property from the given values.
      Parameters:
      name - - the name of the property.
      value - - the value of the property.
      signature - - the BASE64-encoded signature of the value.
      Returns:
      The signed property.
    • getName

      public String getName()
      Retrieve the name of the underlying property, such as "textures".
      Returns:
      Name of the property.
    • getSignature

      public String getSignature()
      Retrieve the signature of the property (base64) as returned by the session server's /hasJoined.
      Returns:
      The signature of the property.
    • getValue

      public String getValue()
      Retrieve the value of the property (base64) as return by the session server's /hasJoined
      Returns:
      The value of the property.
    • hasSignature

      public boolean hasSignature()
      Determine if this property has a signature.
      Returns:
      TRUE if it does, FALSE otherwise.
    • isSignatureValid

      public boolean isSignatureValid(PublicKey key)
      Determine if the signature of this property is valid and signed by the corresponding private key.
      Parameters:
      key - - the public key.
      Returns:
      TRUE if it is, FALSE otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractWrapper
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class AbstractWrapper
    • toString

      public String toString()
      Overrides:
      toString in class AbstractWrapper