Class WrappedProfilePublicKey.WrappedProfileKeyData

java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedProfilePublicKey.WrappedProfileKeyData
Enclosing class:
WrappedProfilePublicKey

public static class WrappedProfilePublicKey.WrappedProfileKeyData extends AbstractWrapper
A wrapper around the data stored in a profile key.
Since:
1.19
  • Constructor Details

    • WrappedProfileKeyData

      public WrappedProfileKeyData(Object handle)
      Constructs a new key data instance directly from the given nms KeyData object.
      Parameters:
      handle - the handle to create the wrapper from.
    • WrappedProfileKeyData

      public WrappedProfileKeyData(Instant expireTime, PublicKey key, byte[] signature)
      Constructs a new data wrapper instance using the given parameters.
      Parameters:
      expireTime - the instant when the key data expires.
      key - the public key used to verify incoming data.
      signature - the signature of the public key.
  • Method Details

    • getExpireTime

      public Instant getExpireTime()
      Get the time instant when this key data expires.
      Returns:
      the time instant when this key data expires.
    • setExpireTime

      public void setExpireTime(Instant expireTime)
      Sets the time when this key data expires.
      Parameters:
      expireTime - the new time when this key data expires.
    • isExpired

      public boolean isExpired()
      Checks if this key data is expired.
      Returns:
      true if this key data is expired, false otherwise.
    • getSignedPayload

      public String getSignedPayload()
      Get the signed payload of this key data. The signature of this data must verify against the payload data of the key. If it does not, the key data is considered unsigned.

      Note that this method takes the expiry time of the key into accountability, if this key is expired it will no longer match the key data signature.

      Returns:
      the signed payload version of this profile key data.
    • getKey

      public PublicKey getKey()
      Get the public key of this key data.
      Returns:
      the public key of this key data.
    • setKey

      public void setKey(PublicKey key)
      Sets the public key of this key data.
      Parameters:
      key - the new public key of this key data.
    • getSignature

      public byte[] getSignature()
      Get the signature of this key data.
      Returns:
      the key data of this signature.
      See Also:
    • setSignature

      public void setSignature(byte[] signature)
      Sets the signature of this key data.
      Parameters:
      signature - the new signature of this key data.
      See Also: