コード例 #1
0
        public AsyncDtlsClientProtocol(AsyncDtlsClient client, SecureRandom secureRandom, IChannel channel, HandshakeHandler parentHandler, DtlsStateHandler handler, Boolean useExtendedMasterSecret, ProtocolVersion initialVersion)
        {
            this.parentHandler = parentHandler;
            this.handler       = handler;

            this.channel         = channel;
            this.protocolVersion = initialVersion;

            AsyncDtlsSecurityParameters securityParameters = new AsyncDtlsSecurityParameters();

            securityParameters.SetEntity(ConnectionEnd.client);

            clientState               = new AsyncDtlsClientState();
            clientState.Client        = client;
            clientState.ClientContext = new AsyncDtlsClientContext(secureRandom, securityParameters);

            securityParameters.SetExtendedMasterSecret(useExtendedMasterSecret);
            securityParameters.SetClientRandom(DtlsHelper.CreateRandomBlock(client.ShouldUseGmtUnixTime(), clientState.ClientContext.NonceRandomGenerator));
            client.InitClient(clientState.ClientContext);

            clientState.HandshakeHash = new DeferredHash();
            clientState.HandshakeHash.Init(clientState.ClientContext);

            recordLayer = new AsyncDtlsRecordLayer(clientState.HandshakeHash, this, channel, clientState.ClientContext, client);
        }
 public AsyncDtlsClientAuthentication(AsyncDtlsClient client)
 {
     this._client = client;
 }