Top Description Methods
org.bouncycastle.tls

public Interface TlsServer

extends TlsPeer
Known Direct Implementers
org.bouncycastle.tls.AbstractTlsServer
Imports
java.io.IOException, java.util.Hashtable, .Vector, org.bouncycastle.tls.crypto.TlsDHConfig, .TlsECConfig

Interface describing a TLS server endpoint.

Method Summary

Modifier and TypeMethod and Description
public CertificateRequest
public CertificateStatus

Returns:

A CertificateStatus to be sent to the client (or null for none).
getCertificateStatus
()

This method will be called (only) if the server included an extension of type "status_request" with empty "extension_data" in the extended server hello.

public TlsCredentials

Returns:

a TlsCredentials object or null for anonymous key exchanges
getCredentials
()

Return server credentials to use.

public TlsDHConfig
public TlsECConfig
public TlsPSKExternal

Returns:

the TlsPSKExternal corresponding to the selected identity, or null to not select any.
getExternalPSK
(Vector<E>
a Vector of PskIdentity instances.
identities
)

Warning

EXPERIMENTAL FEATURE, UNSTABLE API Return the external PSK to select from the ClientHello.

public byte[]
public NewSessionTicket

Returns:

The ticket.
getNewSessionTicket
()

RFC 5077 3.3.

public TlsPSKIdentityManager
public int
public Hashtable<K, V>
public void
public Vector<E>
public ProtocolVersion
public TlsSession

Returns:

A TlsSession with the specified session ID, or null.
getSessionToResume
(byte[]
the ID of the session to resume.
sessionID
)

Return the specified session, if available.

public TlsSRPLoginParameters
public int[]
public void
public void
notifyClientCertificate(Certificate
the effective client certificate (may be an empty chain).
clientCertificate
)

Called by the protocol handler to report the client certificate, only if getCertificateRequest() returned non-null.

public void
public void
notifyFallback(boolean isFallback)

public void
notifyOfferedCipherSuites(int[] offeredCipherSuites)

public void
public void
processClientExtensions(Hashtable<K, V> clientExtensions)

public void
processClientSupplementalData(Vector<E> clientSupplementalData)

Inherited from org.bouncycastle.tls.TlsPeer:
allowLegacyResumptioncancelgetCipherSuitesgetCryptogetHandshakeResendTimeMillisgetHandshakeTimeoutMillisgetHeartbeatgetHeartbeatPolicygetKeyExchangeFactorygetMaxCertificateChainLengthgetMaxHandshakeMessageSizegetProtocolVersionsgetPskKeyExchangeModesgetRenegotiationPolicynotifyAlertRaisednotifyAlertReceivednotifyCloseHandlenotifyConnectionClosednotifyHandshakeBeginningnotifyHandshakeCompletenotifySecureRenegotiationrequiresCloseNotifyrequiresExtendedMasterSecretshouldCheckSigAlgOfPeerCertsshouldUseExtendedMasterSecretshouldUseExtendedPaddingshouldUseGMTUnixTime

Method Detail

getCertificateRequestback to summary
public CertificateRequest getCertificateRequest() throws IOException
getCertificateStatusback to summary
public CertificateStatus getCertificateStatus() throws IOException

This method will be called (only) if the server included an extension of type "status_request" with empty "extension_data" in the extended server hello. See RFC 3546 3.6. Certificate Status Request. If a non-null CertificateStatus is returned, it is sent to the client as a handshake message of type "certificate_status".

Returns:CertificateStatus

A CertificateStatus to be sent to the client (or null for none).

getCredentialsback to summary
public TlsCredentials getCredentials() throws IOException

Return server credentials to use. The returned value may be null, or else it MUST implement exactly one of TlsCredentialedAgreement, TlsCredentialedDecryptor, or TlsCredentialedSigner, depending on the key exchange that was negotiated.

Returns:TlsCredentials

a TlsCredentials object or null for anonymous key exchanges

getDHConfigback to summary
public TlsDHConfig getDHConfig() throws IOException
getECDHConfigback to summary
public TlsECConfig getECDHConfig() throws IOException
getExternalPSKback to summary
public TlsPSKExternal getExternalPSK(Vector<E> identities)

Warning

EXPERIMENTAL FEATURE, UNSTABLE API Return the external PSK to select from the ClientHello. Note that this will only be called when TLS 1.3 or higher is amongst the offered protocol versions, and one or more PSKs are actually offered.

Parameters
identities:Vector<E>

a Vector of PskIdentity instances.

Returns:TlsPSKExternal

the TlsPSKExternal corresponding to the selected identity, or null to not select any.

getNewSessionIDback to summary
public byte[] getNewSessionID()
getNewSessionTicketback to summary
public NewSessionTicket getNewSessionTicket() throws IOException

RFC 5077 3.3. NewSessionTicket Handshake Message.

This method will be called (only) if a NewSessionTicket extension was sent by the server. See RFC 5077 4. Recommended Ticket Construction for recommended format and protection.

Returns:NewSessionTicket

The ticket.

getPSKIdentityManagerback to summary
public TlsPSKIdentityManager getPSKIdentityManager() throws IOException
getSelectedCipherSuiteback to summary
public int getSelectedCipherSuite() throws IOException
getServerExtensionsback to summary
public Hashtable<K, V> getServerExtensions() throws IOException
getServerExtensionsForConnectionback to summary
public void getServerExtensionsForConnection(Hashtable<K, V> serverExtensions) throws IOException
getServerSupplementalDataback to summary
public Vector<E> getServerSupplementalData() throws IOException
getServerVersionback to summary
public ProtocolVersion getServerVersion() throws IOException
getSessionToResumeback to summary
public TlsSession getSessionToResume(byte[] sessionID)

Return the specified session, if available. Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated.

Parameters
sessionID:byte[]

the ID of the session to resume.

Returns:TlsSession

A TlsSession with the specified session ID, or null.

See Also
SessionParameters#getPeerCertificate()
getSRPLoginParametersback to summary
public TlsSRPLoginParameters getSRPLoginParameters() throws IOException
getSupportedGroupsback to summary
public int[] getSupportedGroups() throws IOException
initback to summary
public void init(TlsServerContext context)
notifyClientCertificateback to summary
public void notifyClientCertificate(Certificate clientCertificate) throws IOException

Called by the protocol handler to report the client certificate, only if getCertificateRequest() returned non-null.

Note

this method is responsible for certificate verification and validation.

Parameters
clientCertificate:Certificate

the effective client certificate (may be an empty chain).

notifyClientVersionback to summary
public void notifyClientVersion(ProtocolVersion clientVersion) throws IOException
notifyFallbackback to summary
public void notifyFallback(boolean isFallback) throws IOException
notifyOfferedCipherSuitesback to summary
public void notifyOfferedCipherSuites(int[] offeredCipherSuites) throws IOException
notifySessionback to summary
public void notifySession(TlsSession session)
processClientExtensionsback to summary
public void processClientExtensions(Hashtable<K, V> clientExtensions) throws IOException
processClientSupplementalDataback to summary
public void processClientSupplementalData(Vector<E> clientSupplementalData) throws IOException