public void setOutputSecurityCodec(byte[] key, bool compress) { if (Trace.isInfoEnabled()) { Trace.info(manager + " " + this + " setOutputSecurityCodec key = " + (key == null ? "" : Helper.toHexString(key)) + " compress = " + compress); } Codec codec = new BufferedSink(new NetTaskCodecSink(this)); if (null != key) { codec = new Encrypt(codec, key); } if (compress) { codec = new RFC2118Encode(codec); } output.Dispose(); output = codec; }
public void SetInputSecurityCodec(byte[] key, bool compress) { lock (this) { Codec chain = inputCodecBuffer; if (compress) { chain = new Decompress(chain); } if (null != key) { chain = new Decrypt(chain, key); } inputCodecChain?.Dispose(); inputCodecChain = chain; IsInputSecurity = true; } }
public void SetOutputSecurityCodec(byte[] key, bool compress) { lock (this) { Codec chain = outputCodecBuffer; if (null != key) { chain = new Encrypt(chain, key); } if (compress) { chain = new Compress(chain); } outputCodecChain?.Dispose(); outputCodecChain = chain; IsOutputSecurity = true; } }
public void Dispose() { sink.Dispose(); }
public void Dispose() { cipher.Dispose(); sink.Dispose(); }