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 FNV1a64(parts ...string) string
- func GenerateTOTPSecret() (string, error)
- func GetCert() tls.Certificate
- func GetCertFingerprint(certificate tls.Certificate) []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 ¶
func ComputeHMAC ¶
Get HMAC value
func DecryptBytes ¶
DecryptBytes AES-GCM
func DecryptWithPrivateKey ¶
func EncryptBytes ¶
EncryptBytes AES-GCM
func GenerateTOTPSecret ¶
func GetCert ¶
func GetCert() tls.Certificate
func GetCertFingerprint ¶
func GetCertFingerprint(certificate tls.Certificate) []byte
func GetPublicKeyPEM ¶
func GetRandomString ¶
GetRandomString 生成指定长度的随机密钥,支持可选传入id
func InitTls ¶
func InitTls(customCert tls.Certificate)
func PKCS5Padding ¶
Completion when the length is insufficient
func PrintTOTPCode ¶
func PrintTOTPCode(secret string)
func PrintTOTPSecret ¶
func PrintTOTPSecret()
func ReadClientHello ¶
func ValidateTOTPCode ¶
Types ¶
type LoginPayload ¶
type LoginPayload struct { Nonce string `json:"n"` Timestamp int64 `json:"t"` Password string `json:"p"` }
func ParseLoginPayload ¶
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.