Documentation
¶
Overview ¶
Package crypto provides encryption-related protocol support: TLS deep parsing, encrypted field handling, and authentication protocols.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonCipherSuites = map[uint16]CipherSuite{
0x002F: {0x002F, "TLS_RSA_WITH_AES_128_CBC_SHA", "RSA", "AES-128-CBC", "SHA"},
0x0035: {0x0035, "TLS_RSA_WITH_AES_256_CBC_SHA", "RSA", "AES-256-CBC", "SHA"},
0xC02F: {0xC02F, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "ECDHE-RSA", "AES-128-GCM", "SHA256"},
0xC030: {0xC030, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "ECDHE-RSA", "AES-256-GCM", "SHA384"},
0x1301: {0x1301, "TLS_AES_128_GCM_SHA256", "ANY", "AES-128-GCM", "SHA256"},
0x1302: {0x1302, "TLS_AES_256_GCM_SHA384", "ANY", "AES-256-GCM", "SHA384"},
0x1303: {0x1303, "TLS_CHACHA20_POLY1305_SHA256", "ANY", "CHACHA20-POLY1305", "SHA256"},
0xCCA8: {0xCCA8, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "ECDHE-RSA", "CHACHA20-POLY1305", "SHA256"},
}
CommonCipherSuites contains well-known cipher suites.
Functions ¶
func ParseJWT ¶
func ParseJWT(token string) (*JWTHeader, JWTPayload, error)
ParseJWT parses a JWT token without verification.
func ParseTLSRecord ¶
ParseTLSRecord parses a TLS record header.
func VerifyHMAC ¶
VerifyHMAC verifies an HMAC signature.
Types ¶
type CipherSuite ¶
type CipherSuite struct {
ID uint16 `json:"id"`
Name string `json:"name"`
KeyExchange string `json:"key_exchange"`
Cipher string `json:"cipher"`
MAC string `json:"mac"`
}
CipherSuite describes a TLS cipher suite.
func LookupCipherSuite ¶
func LookupCipherSuite(id uint16) (CipherSuite, bool)
LookupCipherSuite returns info about a cipher suite by ID.
type SSLKeyLog ¶
SSLKeyLog represents a parsed SSLKEYLOGFILE entry.
func ParseSSLKeyLog ¶
ParseSSLKeyLog parses SSLKEYLOGFILE format entries.
type TLSHandshakeType ¶
type TLSHandshakeType uint8
TLSHandshakeType represents a TLS handshake message type.
const ( HandshakeClientHello TLSHandshakeType = 1 HandshakeServerHello TLSHandshakeType = 2 HandshakeCertificate TLSHandshakeType = 11 HandshakeServerKeyExch TLSHandshakeType = 12 HandshakeServerHelloDone TLSHandshakeType = 14 HandshakeClientKeyExch TLSHandshakeType = 16 HandshakeFinished TLSHandshakeType = 20 )
func (TLSHandshakeType) String ¶
func (t TLSHandshakeType) String() string
type TLSVersion ¶
type TLSVersion uint16
TLSVersion represents a TLS version.
const ( TLS10 TLSVersion = 0x0301 TLS11 TLSVersion = 0x0302 TLS12 TLSVersion = 0x0303 TLS13 TLSVersion = 0x0304 )
func (TLSVersion) String ¶
func (v TLSVersion) String() string
Click to show internal directories.
Click to hide internal directories.