Class TlsClientImpl

  • All Implemented Interfaces:
    org.bouncycastle.tls.TlsClient, org.bouncycastle.tls.TlsPeer

    public class TlsClientImpl
    extends org.bouncycastle.tls.DefaultTlsClient
    Implements TlsClient for the purposes of supporting DTLS-SRTP.
    Author:
    Lyubomir Marinov
    • Field Summary

      • Fields inherited from class org.bouncycastle.tls.AbstractTlsClient

        cipherSuites, context, protocolVersions, supportedGroups, supportedSignatureAlgorithms, supportedSignatureAlgorithmsCert
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.tls.TlsAuthentication getAuthentication()
      Hashtable getClientExtensions()
      Includes the use_srtp extension in the DTLS extended client hello.
      protected org.bouncycastle.tls.ProtocolVersion[] getSupportedVersions()
      Always returns ProtocolVersion.DTLSv12.
      void notifyAlertRaised​(short alertLevel, short alertDescription, String message, Throwable cause)
      Forwards to packetTransformer.
      void notifyHandshakeComplete()  
      void processServerExtensions​(Hashtable serverExtensions)
      Makes sure that the DTLS extended server hello contains the use_srtp extension.
      • Methods inherited from class org.bouncycastle.tls.DefaultTlsClient

        getSupportedCipherSuites
      • Methods inherited from class org.bouncycastle.tls.AbstractTlsClient

        allowUnexpectedServerExtension, checkForUnexpectedServerExtension, getAllowedClientCertificateTypes, getAllowedServerCertificateTypes, getCertificateAuthorities, getCertificateStatusRequest, getCipherSuites, getClientSupplementalData, getDHGroupVerifier, getEarlyKeyShareGroups, getExternalPSKs, getMultiCertStatusRequest, getNamedGroupRoles, getNewConnectionID, getProtocolNames, getProtocolVersions, getPSKIdentity, getSessionToResume, getSNIServerNames, getSRPConfigVerifier, getSRPIdentity, getSupportedGroups, getSupportedSignatureAlgorithms, getSupportedSignatureAlgorithmsCert, getTrustedCAIndication, init, isFallback, notifyHandshakeBeginning, notifyNewSessionTicket, notifySelectedCipherSuite, notifySelectedPSK, notifyServerVersion, notifySessionID, notifySessionToResume, processServerSupplementalData
      • Methods inherited from class org.bouncycastle.tls.AbstractTlsPeer

        allowLegacyResumption, cancel, getCrypto, getHandshakeResendTimeMillis, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getMaxCertificateChainLength, getMaxHandshakeMessageSize, getPskKeyExchangeModes, getRenegotiationPolicy, notifyAlertReceived, notifyCloseHandle, notifyConnectionClosed, notifySecureRenegotiation, requiresCloseNotify, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedMasterSecret, shouldUseExtendedPadding, shouldUseGMTUnixTime
      • Methods inherited from interface org.bouncycastle.tls.TlsPeer

        allowLegacyResumption, cancel, getCrypto, getHandshakeResendTimeMillis, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getMaxCertificateChainLength, getMaxHandshakeMessageSize, getPskKeyExchangeModes, getRenegotiationPolicy, notifyAlertReceived, notifyCloseHandle, notifyConnectionClosed, notifySecureRenegotiation, requiresCloseNotify, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedMasterSecret, shouldUseExtendedPadding, shouldUseGMTUnixTime
    • Constructor Detail

      • TlsClientImpl

        public TlsClientImpl​(DtlsPacketTransformer packetTransformer)
        Initializes a new TlsClientImpl instance.
        Parameters:
        packetTransformer - the PacketTransformer which is initializing the new instance
    • Method Detail

      • getAuthentication

        public org.bouncycastle.tls.TlsAuthentication getAuthentication()
      • getSupportedVersions

        protected org.bouncycastle.tls.ProtocolVersion[] getSupportedVersions()
        Always returns ProtocolVersion.DTLSv12.
        Overrides:
        getSupportedVersions in class org.bouncycastle.tls.AbstractTlsPeer
      • getClientExtensions

        public Hashtable getClientExtensions()
                                      throws IOException
        Includes the use_srtp extension in the DTLS extended client hello.
        Specified by:
        getClientExtensions in interface org.bouncycastle.tls.TlsClient
        Overrides:
        getClientExtensions in class org.bouncycastle.tls.AbstractTlsClient
        Throws:
        IOException
      • notifyAlertRaised

        public void notifyAlertRaised​(short alertLevel,
                                      short alertDescription,
                                      String message,
                                      Throwable cause)
        Forwards to packetTransformer.
        Specified by:
        notifyAlertRaised in interface org.bouncycastle.tls.TlsPeer
        Overrides:
        notifyAlertRaised in class org.bouncycastle.tls.AbstractTlsPeer
      • notifyHandshakeComplete

        public void notifyHandshakeComplete()
        Specified by:
        notifyHandshakeComplete in interface org.bouncycastle.tls.TlsPeer
        Overrides:
        notifyHandshakeComplete in class org.bouncycastle.tls.AbstractTlsPeer
      • processServerExtensions

        public void processServerExtensions​(Hashtable serverExtensions)
                                     throws IOException
        Makes sure that the DTLS extended server hello contains the use_srtp extension.
        Specified by:
        processServerExtensions in interface org.bouncycastle.tls.TlsClient
        Overrides:
        processServerExtensions in class org.bouncycastle.tls.AbstractTlsClient
        Throws:
        IOException