Class ServerHello
java.lang.Object
org.bouncycastle.tls.ServerHello
-
Constructor Summary
ConstructorsConstructorDescriptionServerHello(byte[] sessionID, int cipherSuite, Hashtable extensions) A TLS 1.3 HelloRetryRequest, i.e.ServerHello(ProtocolVersion version, byte[] random, byte[] sessionID, int cipherSuite, Hashtable extensions) ServerHello(ProtocolVersion version, byte[] sessionID, int cipherSuite, Hashtable extensions) RFC 8446 4.1.3 and 4.1.4. -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(TlsContext context, OutputStream output) Encode thisServerHelloto anOutputStream.intbyte[]byte[]booleanstatic ServerHelloparse(ByteArrayInputStream input) Parse aServerHellofrom aByteArrayInputStream.
-
Constructor Details
-
ServerHello
A TLS 1.3 HelloRetryRequest, i.e. the 4-argument constructor with the 0x0303 'legacy_version' RFC 8446 4.1.3 gives it. -
ServerHello
public ServerHello(ProtocolVersion version, byte[] sessionID, int cipherSuite, Hashtable extensions) RFC 8446 4.1.3 and 4.1.4. A HelloRetryRequest, which is a ServerHello whose 'random' is the special valueisHelloRetryRequest()recognises, carrying the caller's 'legacy_version': 0x0303 for TLS 1.3 and 0xFEFD for DTLS 1.3 (RFC 9147 5.3). -
ServerHello
public ServerHello(ProtocolVersion version, byte[] random, byte[] sessionID, int cipherSuite, Hashtable extensions)
-
-
Method Details
-
getCipherSuite
public int getCipherSuite() -
getExtensions
-
getRandom
public byte[] getRandom() -
getSessionID
public byte[] getSessionID() -
getVersion
-
isHelloRetryRequest
public boolean isHelloRetryRequest() -
encode
Encode thisServerHelloto anOutputStream.- Parameters:
context- theTlsContextof the current connection.output- theOutputStreamto encode to.- Throws:
IOException
-
parse
Parse aServerHellofrom aByteArrayInputStream.- Parameters:
input- theByteArrayInputStreamto parse from.- Returns:
- a
ServerHelloobject. - Throws:
IOException
-