Documentation ¶
Index ¶
- Constants
- Variables
- type ALPNExtension
- type AlertDescription
- type AlertLevel
- type AlertMsg
- type ClientHelloInfo
- type ClientHelloMsg
- type ECPointFormatsExtension
- type EncryptThenMacExtension
- type ExtendedMasterSecretExtension
- type Extension
- type Random
- type Record
- type RenegotiationInfoExtension
- type ServerHelloInfo
- type ServerHelloMsg
- type ServerNameExtension
- type SessionTicketExtension
- type SignatureAlgorithmsExtension
- type SupportedGroupsExtension
- type SupportedVersionsExtension
- type Version
Constants ¶
View Source
const ( ExtServerName uint16 = 0x00 ExtSupportedGroups uint16 = 0x0a ExtECPointFormats uint16 = 0x0b ExtSignatureAlgorithms uint16 = 0x0d ExtALPN uint16 = 0x10 ExtEncryptThenMac uint16 = 0x16 ExtExtendedMasterSecret uint16 = 0x17 ExtSessionTicket uint16 = 0x23 ExtSupportedVersions uint16 = 0x2b ExtRenegotiationInfo uint16 = 0xff01 )
View Source
const ( HelloRequest uint8 = 0 ClientHello uint8 = 1 ServerHello uint8 = 2 )
View Source
const ( ChangeCipherSpec = 0x14 EncryptedAlert = 0x15 Handshake = 0x16 AppData = 0x17 Heartbeat = 0x18 )
record content type
View Source
const (
RecordHeaderLen = 5
)
Variables ¶
View Source
var ( ErrShortBuffer = errors.New("short buffer") ErrTypeMismatch = errors.New("type mismatch") )
View Source
var ( ErrBadType = errors.New("bad type") ErrAlert = errors.New("alert") )
Functions ¶
This section is empty.
Types ¶
type ALPNExtension ¶ added in v0.1.0
type ALPNExtension struct {
Protos []string
}
func (*ALPNExtension) Decode ¶ added in v0.1.0
func (ext *ALPNExtension) Decode(b []byte) error
func (*ALPNExtension) Encode ¶ added in v0.1.0
func (ext *ALPNExtension) Encode() ([]byte, error)
func (*ALPNExtension) Type ¶ added in v0.1.0
func (ext *ALPNExtension) Type() uint16
type AlertDescription ¶ added in v0.1.1
type AlertDescription uint8
func (AlertDescription) String ¶ added in v0.1.1
func (d AlertDescription) String() string
type AlertLevel ¶ added in v0.1.1
type AlertLevel uint8
func (AlertLevel) String ¶ added in v0.1.1
func (l AlertLevel) String() string
type AlertMsg ¶ added in v0.1.1
type AlertMsg struct { Level AlertLevel Description AlertDescription }
type ClientHelloInfo ¶ added in v0.1.0
type ClientHelloInfo struct { SessionID []byte CipherSuites []uint16 CompressionMethods []uint8 SupportedProtos []string SupportedVersions []uint16 ServerName string }
func ParseClientHello ¶ added in v0.1.0
func ParseClientHello(r io.Reader) (*ClientHelloInfo, error)
type ClientHelloMsg ¶ added in v0.1.0
type ClientHelloMsg struct { Version Version Random Random SessionID []byte CipherSuites []uint16 CompressionMethods []uint8 Extensions []Extension }
func (*ClientHelloMsg) Decode ¶ added in v0.1.0
func (m *ClientHelloMsg) Decode(data []byte) (err error)
func (*ClientHelloMsg) Encode ¶ added in v0.1.0
func (m *ClientHelloMsg) Encode() (data []byte, err error)
type ECPointFormatsExtension ¶ added in v0.1.0
type ECPointFormatsExtension struct {
Formats []uint8
}
func (*ECPointFormatsExtension) Decode ¶ added in v0.1.0
func (ext *ECPointFormatsExtension) Decode(b []byte) error
func (*ECPointFormatsExtension) Encode ¶ added in v0.1.0
func (ext *ECPointFormatsExtension) Encode() ([]byte, error)
func (*ECPointFormatsExtension) Type ¶ added in v0.1.0
func (ext *ECPointFormatsExtension) Type() uint16
type EncryptThenMacExtension ¶ added in v0.1.0
type EncryptThenMacExtension struct {
Data []byte
}
func (*EncryptThenMacExtension) Decode ¶ added in v0.1.0
func (ext *EncryptThenMacExtension) Decode(b []byte) error
func (*EncryptThenMacExtension) Encode ¶ added in v0.1.0
func (ext *EncryptThenMacExtension) Encode() ([]byte, error)
func (*EncryptThenMacExtension) Type ¶ added in v0.1.0
func (ext *EncryptThenMacExtension) Type() uint16
type ExtendedMasterSecretExtension ¶ added in v0.1.0
type ExtendedMasterSecretExtension struct {
Data []byte
}
func (*ExtendedMasterSecretExtension) Decode ¶ added in v0.1.0
func (ext *ExtendedMasterSecretExtension) Decode(b []byte) error
func (*ExtendedMasterSecretExtension) Encode ¶ added in v0.1.0
func (ext *ExtendedMasterSecretExtension) Encode() ([]byte, error)
func (*ExtendedMasterSecretExtension) Type ¶ added in v0.1.0
func (ext *ExtendedMasterSecretExtension) Type() uint16
type RenegotiationInfoExtension ¶ added in v0.1.0
type RenegotiationInfoExtension struct {
Data []byte
}
func (*RenegotiationInfoExtension) Decode ¶ added in v0.1.0
func (ext *RenegotiationInfoExtension) Decode(b []byte) error
func (*RenegotiationInfoExtension) Encode ¶ added in v0.1.0
func (ext *RenegotiationInfoExtension) Encode() ([]byte, error)
func (*RenegotiationInfoExtension) Type ¶ added in v0.1.0
func (ext *RenegotiationInfoExtension) Type() uint16
type ServerHelloInfo ¶ added in v0.1.0
type ServerHelloInfo struct { SessionID []byte CipherSuite uint16 CompressionMethod uint8 Proto string Version uint16 }
func ParseServerHello ¶ added in v0.1.0
func ParseServerHello(r io.Reader) (*ServerHelloInfo, error)
type ServerHelloMsg ¶ added in v0.1.0
type ServerHelloMsg struct { Version Version Random Random SessionID []byte CipherSuite uint16 CompressionMethod uint8 Extensions []Extension }
func (*ServerHelloMsg) Decode ¶ added in v0.1.0
func (m *ServerHelloMsg) Decode(data []byte) (err error)
func (*ServerHelloMsg) Encode ¶ added in v0.1.0
func (m *ServerHelloMsg) Encode() (data []byte, err error)
type ServerNameExtension ¶
func (*ServerNameExtension) Decode ¶ added in v0.1.0
func (ext *ServerNameExtension) Decode(b []byte) error
func (*ServerNameExtension) Encode ¶ added in v0.1.0
func (ext *ServerNameExtension) Encode() ([]byte, error)
func (*ServerNameExtension) Type ¶
func (ext *ServerNameExtension) Type() uint16
type SessionTicketExtension ¶ added in v0.1.0
type SessionTicketExtension struct {
Data []byte
}
func (*SessionTicketExtension) Decode ¶ added in v0.1.0
func (ext *SessionTicketExtension) Decode(b []byte) error
func (*SessionTicketExtension) Encode ¶ added in v0.1.0
func (ext *SessionTicketExtension) Encode() ([]byte, error)
func (*SessionTicketExtension) Type ¶ added in v0.1.0
func (ext *SessionTicketExtension) Type() uint16
type SignatureAlgorithmsExtension ¶ added in v0.1.0
type SignatureAlgorithmsExtension struct {
Algorithms []uint16
}
func (*SignatureAlgorithmsExtension) Decode ¶ added in v0.1.0
func (ext *SignatureAlgorithmsExtension) Decode(b []byte) error
func (*SignatureAlgorithmsExtension) Encode ¶ added in v0.1.0
func (ext *SignatureAlgorithmsExtension) Encode() ([]byte, error)
func (*SignatureAlgorithmsExtension) Type ¶ added in v0.1.0
func (ext *SignatureAlgorithmsExtension) Type() uint16
type SupportedGroupsExtension ¶ added in v0.1.0
type SupportedGroupsExtension struct {
Groups []uint16
}
func (*SupportedGroupsExtension) Decode ¶ added in v0.1.0
func (ext *SupportedGroupsExtension) Decode(b []byte) error
func (*SupportedGroupsExtension) Encode ¶ added in v0.1.0
func (ext *SupportedGroupsExtension) Encode() ([]byte, error)
func (*SupportedGroupsExtension) Type ¶ added in v0.1.0
func (ext *SupportedGroupsExtension) Type() uint16
type SupportedVersionsExtension ¶ added in v0.1.0
func (*SupportedVersionsExtension) Decode ¶ added in v0.1.0
func (ext *SupportedVersionsExtension) Decode(b []byte) error
func (*SupportedVersionsExtension) Encode ¶ added in v0.1.0
func (ext *SupportedVersionsExtension) Encode() ([]byte, error)
func (*SupportedVersionsExtension) Type ¶ added in v0.1.0
func (ext *SupportedVersionsExtension) Type() uint16
Click to show internal directories.
Click to hide internal directories.