Documentation
¶
Index ¶
- Variables
- func AddTrustedCert(vkey string, fp []byte)
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func Blake2b(s string) string
- func ComputeHMAC(vkey string, timestamp int64, randomDataPieces ...[]byte) []byte
- func DecryptBytes(enc []byte, keyStr string) ([]byte, error)
- func DecryptStringWithPrivateKey(base64Cipher string) (string, error)
- func DecryptWithPrivateKey(base64Cipher string) ([]byte, error)
- func EncryptBytes(data []byte, keyStr string) ([]byte, error)
- func GenerateTOTPSecret() (string, error)
- func GetCert() tls.Certificate
- func GetCertFingerprint() []byte
- func GetPublicKeyPEM() (string, error)
- func GetRandomString(l int, id ...int) string
- func GetTOTPCode(secret string) (string, int64, error)
- func InitTls(customCert tls.Certificate)
- func Md5(s string) string
- func NewTlsClientConn(conn net.Conn) net.Conn
- func NewTlsServerConn(conn net.Conn) net.Conn
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) (error, []byte)
- func PrintTOTPCode(secret string)
- func PrintTOTPSecret()
- func ReadClientHello(clientConn net.Conn, prefix []byte) (helloInfo *tls.ClientHelloInfo, rawData []byte, err error)
- func ValidateTOTPCode(secret, code string) (bool, error)
- type LoginPayload
- type ReadOnlyConn
- func (c *ReadOnlyConn) Close() error
- func (c *ReadOnlyConn) LocalAddr() net.Addr
- func (c *ReadOnlyConn) Read(p []byte) (int, error)
- func (c *ReadOnlyConn) RemoteAddr() net.Addr
- func (c *ReadOnlyConn) SetDeadline(_ time.Time) error
- func (c *ReadOnlyConn) SetReadDeadline(_ time.Time) error
- func (c *ReadOnlyConn) SetWriteDeadline(_ time.Time) error
- func (c *ReadOnlyConn) Write(_ []byte) (int, error)
- type SniffConn
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SkipVerify = false
)
Functions ¶
func AddTrustedCert ¶ added in v0.28.1
func ComputeHMAC ¶ added in v0.27.0
Get HMAC value
func DecryptBytes ¶ added in v0.27.0
DecryptBytes AES-GCM
func DecryptStringWithPrivateKey ¶ added in v0.29.2
func DecryptWithPrivateKey ¶ added in v0.29.2
func EncryptBytes ¶ added in v0.27.0
EncryptBytes AES-GCM
func GenerateTOTPSecret ¶ added in v0.29.0
func GetCert ¶
func GetCert() tls.Certificate
func GetCertFingerprint ¶ added in v0.28.0
func GetCertFingerprint() []byte
func GetPublicKeyPEM ¶ added in v0.29.2
func GetRandomString ¶
GetRandomString 生成指定长度的随机密钥,支持可选传入id
func InitTls ¶
func InitTls(customCert tls.Certificate)
func PKCS5Padding ¶
Completion when the length is insufficient
func PrintTOTPCode ¶ added in v0.29.0
func PrintTOTPCode(secret string)
func PrintTOTPSecret ¶ added in v0.29.0
func PrintTOTPSecret()
func ReadClientHello ¶
func ValidateTOTPCode ¶ added in v0.29.0
Types ¶
type LoginPayload ¶ added in v0.29.2
type LoginPayload struct {
Nonce string `json:"n"`
Timestamp int64 `json:"t"`
Password string `json:"p"`
}
func ParseLoginPayload ¶ added in v0.29.2
func ParseLoginPayload(base64Cipher string) (*LoginPayload, error)
type ReadOnlyConn ¶
type ReadOnlyConn struct {
// contains filtered or unexported fields
}
func (*ReadOnlyConn) Close ¶
func (c *ReadOnlyConn) Close() error
func (*ReadOnlyConn) LocalAddr ¶
func (c *ReadOnlyConn) LocalAddr() net.Addr
func (*ReadOnlyConn) RemoteAddr ¶
func (c *ReadOnlyConn) RemoteAddr() net.Addr
func (*ReadOnlyConn) SetDeadline ¶
func (c *ReadOnlyConn) SetDeadline(_ time.Time) error
func (*ReadOnlyConn) SetReadDeadline ¶
func (c *ReadOnlyConn) SetReadDeadline(_ time.Time) error
func (*ReadOnlyConn) SetWriteDeadline ¶
func (c *ReadOnlyConn) SetWriteDeadline(_ time.Time) error
Click to show internal directories.
Click to hide internal directories.