package handshake
Import Path
github.com/pion/dtls/v3/pkg/protocol/handshake (on go.dev)
Dependency Relation
imports 13 packages, and imported by 3 packages
Involved Source Files
cipher_suite.go
errors.go
Package handshake provides the DTLS wire protocol for handshakes
header.go
message_certificate.go
message_certificate_request.go
message_certificate_verify.go
message_client_hello.go
message_client_key_exchange.go
message_finished.go
message_hello_verify_request.go
message_server_hello.go
message_server_hello_done.go
message_server_key_exchange.go
random.go
Package-Level Type Names (total 15)
Handshake protocol is responsible for selecting a cipher spec and
generating a master secret, which together comprise the primary
cryptographic parameters associated with a secure session. The
handshake protocol can also optionally authenticate parties who have
certificates signed by a trusted certificate authority.
https://tools.ietf.org/html/rfc5246#section-7.3
Header Header
KeyExchangeAlgorithm types.KeyExchangeAlgorithm
Message Message
ContentType returns what kind of content this message is carying.
Marshal encodes a handshake into a binary message.
Unmarshal decodes a handshake from a binary message.
*Handshake : github.com/pion/dtls/v3/pkg/protocol.Content
*Handshake : github.com/pion/rtcp.PacketStatusChunk
*Handshake : github.com/gogo/protobuf/proto.Marshaler
*Handshake : github.com/gogo/protobuf/proto.Unmarshaler
*Handshake : github.com/golang/protobuf/proto.Marshaler
*Handshake : github.com/golang/protobuf/proto.Unmarshaler
Header is the static first 12 bytes of each RecordLayer
of type Handshake. These fields allow us to support message loss, reordering, and
message fragmentation,
https://tools.ietf.org/html/rfc6347#section-4.2.2
// uint24 in spec
// uint24 in spec
// uint24 in spec
MessageSequence uint16
Type Type
Marshal encodes the Header.
Unmarshal populates the header from encoded data.
*Header : github.com/pion/rtcp.PacketStatusChunk
*Header : github.com/gogo/protobuf/proto.Marshaler
*Header : github.com/gogo/protobuf/proto.Unmarshaler
*Header : github.com/golang/protobuf/proto.Marshaler
*Header : github.com/golang/protobuf/proto.Unmarshaler
Message is the body of a Handshake datagram.
( Message) Marshal() ([]byte, error)
( Message) Type() Type
( Message) Unmarshal(data []byte) error
*MessageCertificate
*MessageCertificateRequest
*MessageCertificateVerify
*MessageClientHello
*MessageClientKeyExchange
*MessageFinished
*MessageHelloVerifyRequest
*MessageServerHello
*MessageServerHelloDone
*MessageServerKeyExchange
Message : github.com/pion/rtcp.PacketStatusChunk
Message : github.com/gogo/protobuf/proto.Marshaler
Message : github.com/gogo/protobuf/proto.Unmarshaler
Message : github.com/golang/protobuf/proto.Marshaler
Message : github.com/golang/protobuf/proto.Unmarshaler
MessageCertificate is a DTLS Handshake Message
it can contain either a Client or Server Certificate
https://tools.ietf.org/html/rfc5246#section-7.4.2
Certificate [][]byte
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageCertificate : Message
*MessageCertificate : github.com/pion/rtcp.PacketStatusChunk
*MessageCertificate : github.com/gogo/protobuf/proto.Marshaler
*MessageCertificate : github.com/gogo/protobuf/proto.Unmarshaler
*MessageCertificate : github.com/golang/protobuf/proto.Marshaler
*MessageCertificate : github.com/golang/protobuf/proto.Unmarshaler
MessageCertificateRequest is so a non-anonymous server can optionally
request a certificate from the client, if appropriate for the selected cipher
suite. This message, if sent, will immediately follow the ServerKeyExchange
message (if it is sent; otherwise, this message follows the
server's Certificate message).
https://tools.ietf.org/html/rfc5246#section-7.4.4
CertificateAuthoritiesNames [][]byte
CertificateTypes []clientcertificate.Type
SignatureHashAlgorithms []signaturehash.Algorithm
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageCertificateRequest : Message
*MessageCertificateRequest : github.com/pion/rtcp.PacketStatusChunk
*MessageCertificateRequest : github.com/gogo/protobuf/proto.Marshaler
*MessageCertificateRequest : github.com/gogo/protobuf/proto.Unmarshaler
*MessageCertificateRequest : github.com/golang/protobuf/proto.Marshaler
*MessageCertificateRequest : github.com/golang/protobuf/proto.Unmarshaler
MessageCertificateVerify provide explicit verification of a
client certificate.
https://tools.ietf.org/html/rfc5246#section-7.4.8
HashAlgorithm hash.Algorithm
Signature []byte
SignatureAlgorithm signature.Algorithm
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageCertificateVerify : Message
*MessageCertificateVerify : github.com/pion/rtcp.PacketStatusChunk
*MessageCertificateVerify : github.com/gogo/protobuf/proto.Marshaler
*MessageCertificateVerify : github.com/gogo/protobuf/proto.Unmarshaler
*MessageCertificateVerify : github.com/golang/protobuf/proto.Marshaler
*MessageCertificateVerify : github.com/golang/protobuf/proto.Unmarshaler
MessageClientHello is for when a client first connects to a server it is
required to send the client hello as its first message. The client can also send a
client hello in response to a hello request or on its own
initiative in order to renegotiate the security parameters in an
existing connection.
CipherSuiteIDs []uint16
CompressionMethods []*protocol.CompressionMethod
Cookie []byte
Extensions []extension.Extension
Random Random
SessionID []byte
Version protocol.Version
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageClientHello : Message
*MessageClientHello : github.com/pion/rtcp.PacketStatusChunk
*MessageClientHello : github.com/gogo/protobuf/proto.Marshaler
*MessageClientHello : github.com/gogo/protobuf/proto.Unmarshaler
*MessageClientHello : github.com/golang/protobuf/proto.Marshaler
*MessageClientHello : github.com/golang/protobuf/proto.Unmarshaler
MessageClientKeyExchange is a DTLS Handshake Message
With this message, the premaster secret is set, either by direct
transmission of the RSA-encrypted secret or by the transmission of
Diffie-Hellman parameters that will allow each side to agree upon
the same premaster secret.
https://tools.ietf.org/html/rfc5246#section-7.4.7
IdentityHint []byte
for unmarshaling
PublicKey []byte
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageClientKeyExchange : Message
*MessageClientKeyExchange : github.com/pion/rtcp.PacketStatusChunk
*MessageClientKeyExchange : github.com/gogo/protobuf/proto.Marshaler
*MessageClientKeyExchange : github.com/gogo/protobuf/proto.Unmarshaler
*MessageClientKeyExchange : github.com/golang/protobuf/proto.Marshaler
*MessageClientKeyExchange : github.com/golang/protobuf/proto.Unmarshaler
MessageFinished is a DTLS Handshake Message
this message is the first one protected with the just
negotiated algorithms, keys, and secrets. Recipients of Finished
messages MUST verify that the contents are correct.
https://tools.ietf.org/html/rfc5246#section-7.4.9
VerifyData []byte
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageFinished : Message
*MessageFinished : github.com/pion/rtcp.PacketStatusChunk
*MessageFinished : github.com/gogo/protobuf/proto.Marshaler
*MessageFinished : github.com/gogo/protobuf/proto.Unmarshaler
*MessageFinished : github.com/golang/protobuf/proto.Marshaler
*MessageFinished : github.com/golang/protobuf/proto.Unmarshaler
MessageHelloVerifyRequest is as follows:
struct {
ProtocolVersion server_version;
opaque cookie<0..2^8-1>;
} HelloVerifyRequest;
The HelloVerifyRequest message type is hello_verify_request(3).
When the client sends its ClientHello message to the server, the server
MAY respond with a HelloVerifyRequest message. This message contains
a stateless cookie generated using the technique of [PHOTURIS]. The
client MUST retransmit the ClientHello with the cookie added.
https://tools.ietf.org/html/rfc6347#section-4.2.1
Cookie []byte
Version protocol.Version
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageHelloVerifyRequest : Message
*MessageHelloVerifyRequest : github.com/pion/rtcp.PacketStatusChunk
*MessageHelloVerifyRequest : github.com/gogo/protobuf/proto.Marshaler
*MessageHelloVerifyRequest : github.com/gogo/protobuf/proto.Unmarshaler
*MessageHelloVerifyRequest : github.com/golang/protobuf/proto.Marshaler
*MessageHelloVerifyRequest : github.com/golang/protobuf/proto.Unmarshaler
MessageServerHello is sent in response to a ClientHello
message when it was able to find an acceptable set of algorithms.
If it cannot find such a match, it will respond with a handshake
failure alert.
https://tools.ietf.org/html/rfc5246#section-7.4.1.3
CipherSuiteID *uint16
CompressionMethod *protocol.CompressionMethod
Extensions []extension.Extension
Random Random
SessionID []byte
Version protocol.Version
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageServerHello : Message
*MessageServerHello : github.com/pion/rtcp.PacketStatusChunk
*MessageServerHello : github.com/gogo/protobuf/proto.Marshaler
*MessageServerHello : github.com/gogo/protobuf/proto.Unmarshaler
*MessageServerHello : github.com/golang/protobuf/proto.Marshaler
*MessageServerHello : github.com/golang/protobuf/proto.Unmarshaler
MessageServerHelloDone is final non-encrypted message from server
this communicates server has sent all its handshake messages and next
should be MessageFinished.
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageServerHelloDone : Message
*MessageServerHelloDone : github.com/pion/rtcp.PacketStatusChunk
*MessageServerHelloDone : github.com/gogo/protobuf/proto.Marshaler
*MessageServerHelloDone : github.com/gogo/protobuf/proto.Unmarshaler
*MessageServerHelloDone : github.com/golang/protobuf/proto.Marshaler
*MessageServerHelloDone : github.com/golang/protobuf/proto.Unmarshaler
MessageServerKeyExchange supports ECDH and PSK.
EllipticCurveType elliptic.CurveType
HashAlgorithm hash.Algorithm
IdentityHint []byte
for unmarshaling
NamedCurve elliptic.Curve
PublicKey []byte
Signature []byte
SignatureAlgorithm signature.Algorithm
Marshal encodes the Handshake.
Type returns the Handshake Type.
Unmarshal populates the message from encoded data.
*MessageServerKeyExchange : Message
*MessageServerKeyExchange : github.com/pion/rtcp.PacketStatusChunk
*MessageServerKeyExchange : github.com/gogo/protobuf/proto.Marshaler
*MessageServerKeyExchange : github.com/gogo/protobuf/proto.Unmarshaler
*MessageServerKeyExchange : github.com/golang/protobuf/proto.Marshaler
*MessageServerKeyExchange : github.com/golang/protobuf/proto.Unmarshaler
Random value that is used in ClientHello and ServerHello
https://tools.ietf.org/html/rfc4346#section-7.4.1.2
GMTUnixTime time.Time
RandomBytes [28]byte
MarshalFixed encodes the Handshake.
Populate fills the handshakeRandom with random values
may be called multiple times.
UnmarshalFixed populates the message from encoded data.
Type is the unique identifier for each handshake message
https://tools.ietf.org/html/rfc5246#section-7.4
String returns the string representation of this type.
Type : expvar.Var
Type : fmt.Stringer
func Message.Type() Type
func MessageCertificate.Type() Type
func MessageCertificateRequest.Type() Type
func MessageCertificateVerify.Type() Type
func MessageClientHello.Type() Type
func MessageClientKeyExchange.Type() Type
func MessageFinished.Type() Type
func MessageHelloVerifyRequest.Type() Type
func MessageServerHello.Type() Type
func MessageServerHelloDone.Type() Type
func MessageServerKeyExchange.Type() Type
const TypeCertificate
const TypeCertificateRequest
const TypeCertificateVerify
const TypeClientHello
const TypeClientKeyExchange
const TypeFinished
const TypeHelloRequest
const TypeHelloVerifyRequest
const TypeServerHello
const TypeServerHelloDone
const TypeServerKeyExchange
Package-Level Constants (total 14)
HeaderLength msg_len for Handshake messages assumes an extra
12 bytes for sequence, fragment and version information vs TLS.
Consts for Random in Handshake.
Consts for Random in Handshake.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
Types of DTLS Handshake messages we know about.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |