public final class SessionTicket extends Object implements Destroyable
| Modifier and Type | Method and Description |
|---|---|
static SessionTicket |
decode(org.eclipse.californium.elements.util.DatagramReader source)
Creates a session from a byte array containing the binary encoding of a plain text session ticket
that has been created by
encode(DatagramWriter). |
void |
destroy() |
void |
encode(org.eclipse.californium.elements.util.DatagramWriter writer)
Serializes this session into a plain text session ticket
following the structure defined in
RFC 5077.
|
boolean |
equals(Object obj) |
CipherSuite |
getCipherSuite()
Gets the cipher suite.
|
Principal |
getClientIdentity()
Gets the client's identity.
|
CompressionMethod |
getCompressionMethod()
Gets the compression method.
|
SecretKey |
getMasterSecret()
Gets the master secret.
|
ProtocolVersion |
getProtocolVersion()
Gets the protocol version.
|
ServerNames |
getServerNames()
Gets the server names.
|
long |
getTimestamp()
Gets the timestamp in milliseconds.
|
int |
hashCode() |
boolean |
isDestroyed() |
public void encode(org.eclipse.californium.elements.util.DatagramWriter writer)
struct {
ProtocolVersion protocol_version;
CipherSuite cipher_suite;
CompressionMethod compression_method;
opaque master_secret[48];
ClientIdentity client_identity;
uint32 timestamp;
*ServerNames server_names;*
} StatePlaintext;
(The server names are added to be able to check provided server names on session resumption with the server names provided on the full handshake of the session)
This method is useful for e.g. sharing the session with other nodes by means of a cache server or database so that a client can resume a session on another node if this node fails.
The timestampMillis are encoded in seconds. encode and decode therefore lose the milliseconds precision.
writer - The writer to serialize to.public static SessionTicket decode(org.eclipse.californium.elements.util.DatagramReader source)
encode(DatagramWriter).
This method is useful for e.g. sharing the write state with other nodes by means of a cache server or database so that a client can resume a session on another node if this node fails.
source - The encoded session ticket.null if the session ticket is
not encoded according to the structure defined by encode(DatagramWriter).public void destroy()
throws DestroyFailedException
destroy in interface DestroyableDestroyFailedExceptionpublic boolean isDestroyed()
isDestroyed in interface Destroyablepublic final ProtocolVersion getProtocolVersion()
public final SecretKey getMasterSecret()
public final CipherSuite getCipherSuite()
public final CompressionMethod getCompressionMethod()
public final ServerNames getServerNames()
null, if not available.public final Principal getClientIdentity()
null, if not
available.public final long getTimestamp()
System.currentTimeMillis()Copyright © 2023 Eclipse Foundation. All rights reserved.