Documentation ¶
Index ¶
- Variables
- func Decode(s, key []byte) ([]byte, error)
- func Encode(s, key []byte) ([]byte, error)
- func GetBuf(size int) []byte
- func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) (inCount int64, outCount int64, errors []error)
- func PutBuf(buf []byte)
- func WrapConn(conn net.Conn, r io.Reader, w io.Writer, closeFn func() error) net.Conn
- func WrapToTlsConfig(config *configs.TlsConfig) (*tls.Config, error)
- func WrapWithEncryption(conn net.Conn, key []byte) (net.Conn, error)
- func WrapWithTls(lsn net.Listener, config *configs.TlsConfig) (net.Listener, error)
- type AESReader
- type AESWriter
- type WrappedConn
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultSalt = "crypto"
)
Functions ¶
func Join ¶
func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) (inCount int64, outCount int64, errors []error)
Join two io.ReadWriteCloser and do some operations.
Types ¶
type AESReader ¶
type AESReader struct {
// contains filtered or unexported fields
}
Reader is an io.Reader that can read encrypted bytes. Now it only supports aes-128-cfb.
func NewAESReader ¶
NewAESReader returns a new Reader that decrypts bytes from r
type AESWriter ¶
type AESWriter struct {
// contains filtered or unexported fields
}
Writer is an io.Writer that can write encrypted bytes. Now it only support aes-128-cfb.
func NewAESWriter ¶
NewAESWriter returns a new Writer that encrypts bytes to w.
type WrappedConn ¶
func (*WrappedConn) Close ¶
func (rwc *WrappedConn) Close() error
Click to show internal directories.
Click to hide internal directories.