crypt

package
v0.0.0-...-c8733ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamSNI                            = "tls.sni"
	ParamNextProtos                     = "tls.alpn"
	ParamHelloId                        = "tls.profile"
	ParamCertificate                    = "tls.cert"
	ParamPrivateKey                     = "tls.key"
	ParamCertificatePin                 = "tls.pin"
	ParamInsecure                       = "tls.insecure"
	ParamClientCA                       = "tls.clientca"
	CertificatePinDigestMethodSeparator = ":"
	MultipleValuesSeparator             = ","
	MultiplePathsSeparator              = ":"
)

Variables

View Source
var ErrProfileNotSupported = errors.New("profile not supported by uTLS library")

Functions

func GetClientHelloIDFromParams

func GetClientHelloIDFromParams(parameters url.Values) (utls.ClientHelloID, error)

func GetDigestFunc

func GetDigestFunc(method string) func([]byte) []byte

func GetNextProtosFromParams

func GetNextProtosFromParams(parameters url.Values) []string

func GetSNIFromParams

func GetSNIFromParams(parameters url.Values) string

func LoadCertPoolFromParams

func LoadCertPoolFromParams(parameters url.Values, paramName string) (*x509.CertPool, int, error)

func LoadCertsFromParams

func LoadCertsFromParams(parameters url.Values, paramName string) ([]*x509.Certificate, error)

func LoadX509PairBytes

func LoadX509PairBytes(certPath, keyPath string) (cert []byte, key []byte, err error)

func LoadX509PairBytesFromParams

func LoadX509PairBytesFromParams(parameters url.Values) (cert []byte, key []byte, err error)

func LoadX509PairFromParams

func LoadX509PairFromParams(parameters url.Values) (utls.Certificate, error)

func LoadX509PairsBytesFromParams

func LoadX509PairsBytesFromParams(parameters url.Values) (certs [][]byte, keys [][]byte, err error)

func LoadX509PairsFromParams

func LoadX509PairsFromParams(parameters url.Values) ([]utls.Certificate, error)

func ParseUTLS

func ParseUTLS(parameters url.Values, isClient bool) (config *utls.Config, helloId utls.ClientHelloID, e error)

func Sha1Sum

func Sha1Sum(in []byte) []byte

func Sha224Sum

func Sha224Sum(in []byte) []byte

func Sha256Sum

func Sha256Sum(in []byte) []byte

func Sha384Sum

func Sha384Sum(in []byte) []byte

func Sha3Sum

func Sha3Sum(in []byte) []byte

func Sha512Sum

func Sha512Sum(in []byte) []byte

Types

type CertificatePin

type CertificatePin struct {
	DigestFunc func([]byte) []byte
	Digest     []byte
}

type PeerVerifierFunc

type PeerVerifierFunc func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error

func GetCertificatePinningAndInsecure

func GetCertificatePinningAndInsecure(parameters url.Values) (vFunc PeerVerifierFunc, insecureBool bool, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL