Package com.comphenix.protocol.wrappers
Class WrappedProfilePublicKey.WrappedProfileKeyData
java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedProfilePublicKey.WrappedProfileKeyData
- Enclosing class:
WrappedProfilePublicKey
A wrapper around the data stored in a profile key.
- Since:
- 1.19
-
Field Summary
Fields inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
handle, handleType -
Constructor Summary
ConstructorsConstructorDescriptionWrappedProfileKeyData(Object handle) Constructs a new key data instance directly from the given nms KeyData object.WrappedProfileKeyData(Instant expireTime, PublicKey key, byte[] signature) Constructs a new data wrapper instance using the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionGet the time instant when this key data expires.getKey()Get the public key of this key data.byte[]Get the signature of this key data.Get the signed payload of this key data.booleanChecks if this key data is expired.voidsetExpireTime(Instant expireTime) Sets the time when this key data expires.voidSets the public key of this key data.voidsetSignature(byte[] signature) Sets the signature of this key data.Methods inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
equals, getHandle, getHandleType, hashCode, setHandle, toString
-
Constructor Details
-
WrappedProfileKeyData
Constructs a new key data instance directly from the given nms KeyData object.- Parameters:
handle- the handle to create the wrapper from.
-
WrappedProfileKeyData
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
Get the time instant when this key data expires.- Returns:
- the time instant when this key data expires.
-
setExpireTime
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
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
Get the public key of this key data.- Returns:
- the public key of this key data.
-
setKey
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:
-