public NewSessionTicket getNewSessionTicket() throws IOException { /* * RFC 5077 3.3. If the server determines that it does not want to include a ticket after it * has included the SessionTicket extension in the ServerHello, then it sends a zero-length * ticket in the NewSessionTicket handshake message. */ return new NewSessionTicket(0L, TlsUtils.EMPTY_BYTES); } }
protected byte[] generateNewSessionTicket(ServerHandshakeState state, NewSessionTicket newSessionTicket) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); newSessionTicket.encode(buf); return buf.toByteArray(); }
protected void processNewSessionTicket(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); TlsProtocol.assertEmpty(buf); state.client.notifyNewSessionTicket(newSessionTicket); }
protected void processNewSessionTicket(ClientHandshakeState state, byte[] body) throws IOException { ByteArrayInputStream buf = new ByteArrayInputStream(body); NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); TlsProtocol.assertEmpty(buf); state.client.notifyNewSessionTicket(newSessionTicket); }
protected void receiveNewSessionTicketMessage(ByteArrayInputStream buf) throws IOException { NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); assertEmpty(buf); tlsClient.notifyNewSessionTicket(newSessionTicket); }
protected byte[] generateNewSessionTicket(ServerHandshakeState state, NewSessionTicket newSessionTicket) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); newSessionTicket.encode(buf); return buf.toByteArray(); }
public NewSessionTicket getNewSessionTicket() throws IOException { /* * RFC 5077 3.3. If the server determines that it does not want to include a ticket after it * has included the SessionTicket extension in the ServerHello, then it sends a zero-length * ticket in the NewSessionTicket handshake message. */ return new NewSessionTicket(0L, TlsUtils.EMPTY_BYTES); } }
protected void receiveNewSessionTicketMessage(ByteArrayInputStream buf) throws IOException { NewSessionTicket newSessionTicket = NewSessionTicket.parse(buf); assertEmpty(buf); tlsClient.notifyNewSessionTicket(newSessionTicket); }
protected void sendNewSessionTicketMessage(NewSessionTicket newSessionTicket) throws IOException { if (newSessionTicket == null) { throw new TlsFatalAlert(AlertDescription.internal_error); } HandshakeMessage message = new HandshakeMessage(HandshakeType.session_ticket); newSessionTicket.encode(message); message.writeToRecordStream(); }
/** * Parse a {@link NewSessionTicket} from an {@link InputStream}. * * @param input the {@link InputStream} to parse from. * @return a {@link NewSessionTicket} object. * @throws IOException */ public static NewSessionTicket parse(InputStream input) throws IOException { long ticketLifetimeHint = TlsUtils.readUint32(input); byte[] ticket = TlsUtils.readOpaque16(input); return new NewSessionTicket(ticketLifetimeHint, ticket); } }
protected void sendNewSessionTicketMessage(NewSessionTicket newSessionTicket) throws IOException { if (newSessionTicket == null) { throw new TlsFatalAlert(AlertDescription.internal_error); } HandshakeMessage message = new HandshakeMessage(HandshakeType.session_ticket); newSessionTicket.encode(message); message.writeToRecordStream(); }
/** * Parse a {@link NewSessionTicket} from an {@link InputStream}. * * @param input the {@link InputStream} to parse from. * @return a {@link NewSessionTicket} object. * @throws IOException */ public static NewSessionTicket parse(InputStream input) throws IOException { long ticketLifetimeHint = TlsUtils.readUint32(input); byte[] ticket = TlsUtils.readOpaque16(input); return new NewSessionTicket(ticketLifetimeHint, ticket); } }