public DTLSContext(bool client, Version version, HandshakeInfo handshakeInfo) { IsServer = !client; if (version == DTLSRecord.Version1_2) { ClientVersion = ProtocolVersion.DTLSv12; ServerVersion = ProtocolVersion.DTLSv12; } else { ClientVersion = ProtocolVersion.DTLSv10; ServerVersion = ProtocolVersion.DTLSv10; } SecurityParameters = new DTLSSecurityParameters(version, handshakeInfo); NonceRandomGenerator = new DigestRandomGenerator(TlsUtilities.CreateHash(HashAlgorithm.sha256)); NonceRandomGenerator.AddSeedMaterial(Times.NanoTime()); }