Package com.comphenix.protocol.wrappers
Class WrappedSignedProperty
java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedSignedProperty
Represents a wrapper over a signed property.
-
Field Summary
Fields inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
handle, handleType -
Constructor Summary
ConstructorsConstructorDescriptionWrappedSignedProperty(String name, String value, String signature) Construct a new wrapped signed property from the given values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic WrappedSignedPropertyfromHandle(Object handle) Construct a new signed property from a given NMS property.static WrappedSignedPropertyfromValues(String name, String value, String signature) Construct a new wrapped signed property from the given values.getName()Retrieve the name of the underlying property, such as "textures".Retrieve the signature of the property (base64) as returned by the session server's /hasJoined.getValue()Retrieve the value of the property (base64) as return by the session server's /hasJoinedinthashCode()booleanDetermine if this property has a signature.booleanDetermine if the signature of this property is valid and signed by the corresponding private key.toString()Methods inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
getHandle, getHandleType, setHandle
-
Constructor Details
-
WrappedSignedProperty
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
Construct a new signed property from a given NMS property.- Parameters:
handle- - the property.- Returns:
- The wrapped signed property.
-
fromValues
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
Retrieve the name of the underlying property, such as "textures".- Returns:
- Name of the property.
-
getSignature
Retrieve the signature of the property (base64) as returned by the session server's /hasJoined.- Returns:
- The signature of the property.
-
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
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:
hashCodein classAbstractWrapper
-
equals
- Overrides:
equalsin classAbstractWrapper
-
toString
- Overrides:
toStringin classAbstractWrapper
-