Documentation ¶
Index ¶
- Constants
- Variables
- func Fingerprint(cert *x509.Certificate, algo HashAlgorithm) (string, error)
- func GenerateSelfSigned() (*x509.Certificate, crypto.PrivateKey, error)
- type Config
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ExportKeyingMaterial(label []byte, context []byte, length int) ([]byte, error)
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(p []byte) (n int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) RemoteCertificate() *x509.Certificate
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(p []byte) (int, error)
- type HashAlgorithm
- type Listener
Constants ¶
const (
SRTP_AES128_CM_HMAC_SHA1_80 srtpProtectionProfile = 0x0001 // nolint
)
Variables ¶
var (
ErrConnClosed = errors.New("dtls: conn is closed")
)
Typed errors
Functions ¶
func Fingerprint ¶
func Fingerprint(cert *x509.Certificate, algo HashAlgorithm) (string, error)
Fingerprint creates a fingerprint for a certificate using the specified hash algorithm
func GenerateSelfSigned ¶
func GenerateSelfSigned() (*x509.Certificate, crypto.PrivateKey, error)
GenerateSelfSigned creates a self-signed certificate
Types ¶
type Config ¶
type Config struct { Certificate *x509.Certificate PrivateKey crypto.PrivateKey }
Config is used to configure a DTLS client or server. After a Config is passed to a DTLS function it must not be modified.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a DTLS connection
func (*Conn) ExportKeyingMaterial ¶
ExportKeyingMaterial from https://tools.ietf.org/html/rfc5705 This allows protocols to use DTLS for key establishment, but then use some of the keying material for their own purposes
func (*Conn) RemoteCertificate ¶
func (c *Conn) RemoteCertificate() *x509.Certificate
RemoteCertificate exposes the remote certificate
func (*Conn) SetReadDeadline ¶
SetReadDeadline is a stub
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline is a stub
type HashAlgorithm ¶
type HashAlgorithm uint16
HashAlgorithm is used to indicate the hash algorithm used https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-18
const ( // HashAlgorithmMD2 HashAlgorithm = 0 // Blacklisted HashAlgorithmMD5 HashAlgorithm = 1 // Blacklisted HashAlgorithmSHA1 HashAlgorithm = 2 // Blacklisted HashAlgorithmSHA224 HashAlgorithm = 3 HashAlgorithmSHA256 HashAlgorithm = 4 HashAlgorithmSHA384 HashAlgorithm = 5 HashAlgorithmSHA512 HashAlgorithm = 6 )
Supported hash hash algorithms
func HashAlgorithmString ¶
func HashAlgorithmString(s string) (HashAlgorithm, error)
HashAlgorithmString allows looking up a HashAlgorithm by it's string representation
func (HashAlgorithm) String ¶
func (h HashAlgorithm) String() string
String makes HashAlgorithm printable
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener represents a DTLS listener
func (*Listener) Accept ¶
Accept waits for and returns the next connection to the listener. You have to either close or read on all connection that are created.
Source Files ¶
- alert.go
- application_data.go
- change_cipher_spec.go
- cipher_suite.go
- cipher_suite_tls_ecdhe_ecdsa_with_aes_128_gcm_sha256.go
- cipher_suite_tls_ecdhe_ecdsa_with_aes_256_cbc_sha.go
- cipher_suite_tls_ecdhe_rsa_with_aes_128_gcm_sha256.go
- cipher_suite_tls_ecdhe_rsa_with_aes_256_cbc_sha.go
- client_certificate_type.go
- client_handlers.go
- compression_method.go
- config.go
- conn.go
- content.go
- crypto.go
- crypto_cbc.go
- crypto_gcm.go
- curve_type.go
- errors.go
- extension.go
- extension_supported_elliptic_curves.go
- extension_supported_point_formats.go
- extension_use_srtp.go
- fingerprint.go
- flight.go
- fragment_buffer.go
- handshake.go
- handshake_cache.go
- handshake_header.go
- handshake_message_certificate.go
- handshake_message_certificate_request.go
- handshake_message_certificate_verify.go
- handshake_message_client_hello.go
- handshake_message_client_key_exchange.go
- handshake_message_finished.go
- handshake_message_hello_verify_request.go
- handshake_message_server_hello.go
- handshake_message_server_hello_done.go
- handshake_message_server_key_exchange.go
- handshake_random.go
- hash_algorithm.go
- listener.go
- named_curve.go
- prf.go
- record_layer.go
- record_layer_header.go
- server_handlers.go
- signature_algorithm.go
- signature_hash_algorithm.go
- srtp_protection_profile.go
- util.go