ciphersuite

package
v2.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ciphersuite provides TLS Ciphers as registered with the IANA https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aes128Ccm

type Aes128Ccm struct {
	// contains filtered or unexported fields
}

Aes128Ccm is a base class used by multiple AES-CCM Ciphers

func NewTLSEcdheEcdsaWithAes128Ccm

func NewTLSEcdheEcdsaWithAes128Ccm() *Aes128Ccm

NewTLSEcdheEcdsaWithAes128Ccm constructs a TLS_ECDHE_ECDSA_WITH_AES_128_CCM Cipher

func NewTLSEcdheEcdsaWithAes128Ccm8

func NewTLSEcdheEcdsaWithAes128Ccm8() *Aes128Ccm

NewTLSEcdheEcdsaWithAes128Ccm8 creates a new TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 CipherSuite

func NewTLSPskWithAes128Ccm

func NewTLSPskWithAes128Ccm() *Aes128Ccm

NewTLSPskWithAes128Ccm returns the TLS_PSK_WITH_AES_128_CCM CipherSuite

func NewTLSPskWithAes128Ccm8

func NewTLSPskWithAes128Ccm8() *Aes128Ccm

NewTLSPskWithAes128Ccm8 returns the TLS_PSK_WITH_AES_128_CCM_8 CipherSuite

func (*Aes128Ccm) AuthenticationType

func (c *Aes128Ccm) AuthenticationType() AuthenticationType

AuthenticationType controls what authentication method is using during the handshake

func (*Aes128Ccm) CertificateType

func (c *Aes128Ccm) CertificateType() clientcertificate.Type

CertificateType returns what type of certificate this CipherSuite exchanges

func (*Aes128Ccm) Decrypt

func (c *Aes128Ccm) Decrypt(raw []byte) ([]byte, error)

Decrypt decrypts a single TLS RecordLayer

func (*Aes128Ccm) Encrypt

func (c *Aes128Ccm) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypts a single TLS RecordLayer

func (*Aes128Ccm) HashFunc

func (c *Aes128Ccm) HashFunc() func() hash.Hash

HashFunc returns the hashing func for this CipherSuite

func (*Aes128Ccm) ID

func (c *Aes128Ccm) ID() ID

ID returns the ID of the CipherSuite

func (*Aes128Ccm) Init

func (c *Aes128Ccm) Init(masterSecret, clientRandom, serverRandom []byte, isClient bool) error

Init initializes the internal Cipher with keying material

func (*Aes128Ccm) IsInitialized

func (c *Aes128Ccm) IsInitialized() bool

IsInitialized returns if the CipherSuite has keying material and can encrypt/decrypt packets

func (*Aes128Ccm) String

func (c *Aes128Ccm) String() string

type AuthenticationType

type AuthenticationType int

AuthenticationType controls what authentication method is using during the handshake

const (
	AuthenticationTypeCertificate AuthenticationType = iota + 1
	AuthenticationTypePreSharedKey
	AuthenticationTypeAnonymous
)

AuthenticationType Enums

type ID

type ID uint16

ID is an ID for our supported CipherSuites

const (
	// AES-128-CCM
	TLS_ECDHE_ECDSA_WITH_AES_128_CCM   ID = 0xc0ac //nolint:golint,stylecheck
	TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 ID = 0xc0ae //nolint:golint,stylecheck

	// AES-128-GCM-SHA256
	TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ID = 0xc02b //nolint:golint,stylecheck
	TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256   ID = 0xc02f //nolint:golint,stylecheck

	// AES-256-CBC-SHA
	TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA ID = 0xc00a //nolint:golint,stylecheck
	TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA   ID = 0xc014 //nolint:golint,stylecheck

	TLS_PSK_WITH_AES_128_CCM        ID = 0xc0a4 //nolint:golint,stylecheck
	TLS_PSK_WITH_AES_128_CCM_8      ID = 0xc0a8 //nolint:golint,stylecheck
	TLS_PSK_WITH_AES_128_GCM_SHA256 ID = 0x00a8 //nolint:golint,stylecheck
	TLS_PSK_WITH_AES_128_CBC_SHA256 ID = 0x00ae //nolint:golint,stylecheck
)

Supported Cipher Suites

func (ID) String

func (i ID) String() string

type TLSEcdheEcdsaWithAes128GcmSha256

type TLSEcdheEcdsaWithAes128GcmSha256 struct {
	// contains filtered or unexported fields
}

TLSEcdheEcdsaWithAes128GcmSha256 represents a TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 CipherSuite

func (*TLSEcdheEcdsaWithAes128GcmSha256) AuthenticationType

func (c *TLSEcdheEcdsaWithAes128GcmSha256) AuthenticationType() AuthenticationType

AuthenticationType controls what authentication method is using during the handshake

func (*TLSEcdheEcdsaWithAes128GcmSha256) CertificateType

CertificateType returns what type of certficate this CipherSuite exchanges

func (*TLSEcdheEcdsaWithAes128GcmSha256) Decrypt

func (c *TLSEcdheEcdsaWithAes128GcmSha256) Decrypt(raw []byte) ([]byte, error)

Decrypt decrypts a single TLS RecordLayer

func (*TLSEcdheEcdsaWithAes128GcmSha256) Encrypt

Encrypt encrypts a single TLS RecordLayer

func (*TLSEcdheEcdsaWithAes128GcmSha256) HashFunc

func (c *TLSEcdheEcdsaWithAes128GcmSha256) HashFunc() func() hash.Hash

HashFunc returns the hashing func for this CipherSuite

func (*TLSEcdheEcdsaWithAes128GcmSha256) ID

ID returns the ID of the CipherSuite

func (*TLSEcdheEcdsaWithAes128GcmSha256) Init

func (c *TLSEcdheEcdsaWithAes128GcmSha256) Init(masterSecret, clientRandom, serverRandom []byte, isClient bool) error

Init initializes the internal Cipher with keying material

func (*TLSEcdheEcdsaWithAes128GcmSha256) IsInitialized

func (c *TLSEcdheEcdsaWithAes128GcmSha256) IsInitialized() bool

IsInitialized returns if the CipherSuite has keying material and can encrypt/decrypt packets

func (*TLSEcdheEcdsaWithAes128GcmSha256) String

type TLSEcdheEcdsaWithAes256CbcSha

type TLSEcdheEcdsaWithAes256CbcSha struct {
	// contains filtered or unexported fields
}

TLSEcdheEcdsaWithAes256CbcSha represents a TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA CipherSuite

func (*TLSEcdheEcdsaWithAes256CbcSha) AuthenticationType

func (c *TLSEcdheEcdsaWithAes256CbcSha) AuthenticationType() AuthenticationType

AuthenticationType controls what authentication method is using during the handshake

func (*TLSEcdheEcdsaWithAes256CbcSha) CertificateType

CertificateType returns what type of certficate this CipherSuite exchanges

func (*TLSEcdheEcdsaWithAes256CbcSha) Decrypt

func (c *TLSEcdheEcdsaWithAes256CbcSha) Decrypt(raw []byte) ([]byte, error)

Decrypt decrypts a single TLS RecordLayer

func (*TLSEcdheEcdsaWithAes256CbcSha) Encrypt

func (c *TLSEcdheEcdsaWithAes256CbcSha) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypts a single TLS RecordLayer

func (*TLSEcdheEcdsaWithAes256CbcSha) HashFunc

func (c *TLSEcdheEcdsaWithAes256CbcSha) HashFunc() func() hash.Hash

HashFunc returns the hashing func for this CipherSuite

func (*TLSEcdheEcdsaWithAes256CbcSha) ID

ID returns the ID of the CipherSuite

func (*TLSEcdheEcdsaWithAes256CbcSha) Init

func (c *TLSEcdheEcdsaWithAes256CbcSha) Init(masterSecret, clientRandom, serverRandom []byte, isClient bool) error

Init initializes the internal Cipher with keying material

func (*TLSEcdheEcdsaWithAes256CbcSha) IsInitialized

func (c *TLSEcdheEcdsaWithAes256CbcSha) IsInitialized() bool

IsInitialized returns if the CipherSuite has keying material and can encrypt/decrypt packets

func (*TLSEcdheEcdsaWithAes256CbcSha) String

type TLSEcdheRsaWithAes128GcmSha256

type TLSEcdheRsaWithAes128GcmSha256 struct {
	TLSEcdheEcdsaWithAes128GcmSha256
}

TLSEcdheRsaWithAes128GcmSha256 implements the TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 CipherSuite

func (*TLSEcdheRsaWithAes128GcmSha256) CertificateType

CertificateType returns what type of certificate this CipherSuite exchanges

func (*TLSEcdheRsaWithAes128GcmSha256) ID

ID returns the ID of the CipherSuite

func (*TLSEcdheRsaWithAes128GcmSha256) String

type TLSEcdheRsaWithAes256CbcSha

type TLSEcdheRsaWithAes256CbcSha struct {
	TLSEcdheEcdsaWithAes256CbcSha
}

TLSEcdheRsaWithAes256CbcSha implements the TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA CipherSuite

func (*TLSEcdheRsaWithAes256CbcSha) CertificateType

func (c *TLSEcdheRsaWithAes256CbcSha) CertificateType() clientcertificate.Type

CertificateType returns what type of certificate this CipherSuite exchanges

func (*TLSEcdheRsaWithAes256CbcSha) ID

ID returns the ID of the CipherSuite

func (*TLSEcdheRsaWithAes256CbcSha) String

func (c *TLSEcdheRsaWithAes256CbcSha) String() string

type TLSPskWithAes128CbcSha256

type TLSPskWithAes128CbcSha256 struct {
	// contains filtered or unexported fields
}

TLSPskWithAes128CbcSha256 implements the TLS_PSK_WITH_AES_128_CBC_SHA256 CipherSuite

func (*TLSPskWithAes128CbcSha256) AuthenticationType

func (c *TLSPskWithAes128CbcSha256) AuthenticationType() AuthenticationType

AuthenticationType controls what authentication method is using during the handshake

func (*TLSPskWithAes128CbcSha256) CertificateType

func (c *TLSPskWithAes128CbcSha256) CertificateType() clientcertificate.Type

CertificateType returns what type of certificate this CipherSuite exchanges

func (*TLSPskWithAes128CbcSha256) Decrypt

func (c *TLSPskWithAes128CbcSha256) Decrypt(raw []byte) ([]byte, error)

Decrypt decrypts a single TLS RecordLayer

func (*TLSPskWithAes128CbcSha256) Encrypt

func (c *TLSPskWithAes128CbcSha256) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

Encrypt encrypts a single TLS RecordLayer

func (*TLSPskWithAes128CbcSha256) HashFunc

func (c *TLSPskWithAes128CbcSha256) HashFunc() func() hash.Hash

HashFunc returns the hashing func for this CipherSuite

func (*TLSPskWithAes128CbcSha256) ID

func (c *TLSPskWithAes128CbcSha256) ID() ID

ID returns the ID of the CipherSuite

func (*TLSPskWithAes128CbcSha256) Init

func (c *TLSPskWithAes128CbcSha256) Init(masterSecret, clientRandom, serverRandom []byte, isClient bool) error

Init initializes the internal Cipher with keying material

func (*TLSPskWithAes128CbcSha256) IsInitialized

func (c *TLSPskWithAes128CbcSha256) IsInitialized() bool

IsInitialized returns if the CipherSuite has keying material and can encrypt/decrypt packets

func (*TLSPskWithAes128CbcSha256) String

func (c *TLSPskWithAes128CbcSha256) String() string

type TLSPskWithAes128GcmSha256

type TLSPskWithAes128GcmSha256 struct {
	TLSEcdheEcdsaWithAes128GcmSha256
}

TLSPskWithAes128GcmSha256 implements the TLS_PSK_WITH_AES_128_GCM_SHA256 CipherSuite

func (*TLSPskWithAes128GcmSha256) AuthenticationType

func (c *TLSPskWithAes128GcmSha256) AuthenticationType() AuthenticationType

AuthenticationType controls what authentication method is using during the handshake

func (*TLSPskWithAes128GcmSha256) CertificateType

func (c *TLSPskWithAes128GcmSha256) CertificateType() clientcertificate.Type

CertificateType returns what type of certificate this CipherSuite exchanges

func (*TLSPskWithAes128GcmSha256) ID

func (c *TLSPskWithAes128GcmSha256) ID() ID

ID returns the ID of the CipherSuite

func (*TLSPskWithAes128GcmSha256) String

func (c *TLSPskWithAes128GcmSha256) String() string

Jump to

Keyboard shortcuts

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