Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKeyPair(kem hpke.KEM) (kem.PublicKey, kem.PrivateKey, error)
- func MarshalECHConfigArgs(configs ...ECHConfig) ([]byte, error)
- func MarshalECHConfigList(configs []ECHConfig) ([]byte, error)
- func MarshalECHKeySetArgs(keysets ...ECHKeySet) ([]byte, error)
- func MarshalECHKeySetList(keysets []ECHKeySet) ([]byte, error)
- type ECHConfig
- func (ech *ECHConfig) Equal(other *ECHConfig) bool
- func (ech *ECHConfig) FromBase64(echConfigBase64 string) error
- func (ech ECHConfig) MarshalBinary() ([]byte, error)
- func (ech ECHConfig) String() string
- func (ech ECHConfig) ToBase64() (string, error)
- func (ech ECHConfig) ToBase64OrPanic() string
- func (ech *ECHConfig) UnmarshalBinary(data []byte) error
- type ECHConfigList
- func (configs ECHConfigList) Equal(other ECHConfigList) bool
- func (configs *ECHConfigList) FromBase64(echConfigListBase64 string) error
- func (configs ECHConfigList) MarshalBinary() ([]byte, error)
- func (configs ECHConfigList) ToBase64() (string, error)
- func (configs ECHConfigList) ToBase64OrPanic() string
- func (configs *ECHConfigList) UnmarshalBinary(data []byte) error
- type ECHKeySet
- func (key *ECHKeySet) Equal(other *ECHKeySet) bool
- func (key *ECHKeySet) FromBase64(keySetBase64 string) error
- func (key *ECHKeySet) MarshalBinary() ([]byte, error)
- func (key *ECHKeySet) String() string
- func (key *ECHKeySet) ToBase64() (string, error)
- func (key *ECHKeySet) ToBase64OrPanic() string
- func (key *ECHKeySet) UnmarshalBinary(data []byte) error
- type ECHKeySetList
- func (keysets ECHKeySetList) Equal(other ECHKeySetList) bool
- func (keysets *ECHKeySetList) FromBase64(keySetListBase64 string) error
- func (keysets ECHKeySetList) MarshalBinary() ([]byte, error)
- func (keysets ECHKeySetList) ToBase64() (string, error)
- func (keysets ECHKeySetList) ToBase64OrPanic() string
- func (keysets *ECHKeySetList) UnmarshalBinary(data []byte) error
- type HpkeSymmetricCipherSuite
- type InvalidAEADError
- type InvalidKDFError
- type InvalidKEMError
- type InvalidPublicNameLenError
Constants ¶
View Source
const (
DraftTLSESNI16 = 0xfe0d
)
Variables ¶
View Source
var ( KDFMapping = [...]string{ hpke.KDF_HKDF_SHA256: "SHA256", hpke.KDF_HKDF_SHA384: "SHA384", hpke.KDF_HKDF_SHA512: "SHA512", } AEADMapping = [...]string{ hpke.AEAD_AES128GCM: "AES128GCM", hpke.AEAD_AES256GCM: "AES256GCM", hpke.AEAD_ChaCha20Poly1305: "CHACHA20POLY1305", } KemMapping = [...]string{ hpke.KEM_P256_HKDF_SHA256: "P256-SHA256", hpke.KEM_P384_HKDF_SHA384: "P384-SHA384", hpke.KEM_P521_HKDF_SHA512: "P521-SHA512", hpke.KEM_X25519_HKDF_SHA256: "X25519-SHA256", hpke.KEM_X448_HKDF_SHA512: "X25519-SHA512", } )
View Source
var ( ErrNotSupportedVersion = fmt.Errorf("goech: %d is the only supported version", DraftTLSESNI16) ErrInvalidLen = errors.New("goech: invalid length") )
Functions ¶
func GenerateKeyPair ¶
func MarshalECHConfigArgs ¶
func MarshalECHConfigList ¶
func MarshalECHKeySetArgs ¶
func MarshalECHKeySetList ¶
Types ¶
type ECHConfig ¶
type ECHConfig struct { PublicKey kem.PublicKey Version uint16 ConfigID uint8 RawPublicName []byte KEM hpke.KEM CipherSuites []HpkeSymmetricCipherSuite MaxNameLength uint8 RawExtensions []byte }
func (*ECHConfig) FromBase64 ¶
func (ECHConfig) MarshalBinary ¶
func (ECHConfig) ToBase64OrPanic ¶
func (*ECHConfig) UnmarshalBinary ¶
type ECHConfigList ¶
type ECHConfigList []ECHConfig
func ECHConfigListFromBase64 ¶
func ECHConfigListFromBase64(echConfigListBase64 string) (ECHConfigList, error)
func UnmarshalECHConfigList ¶
func UnmarshalECHConfigList(data []byte) (configList ECHConfigList, err error)
func (ECHConfigList) Equal ¶
func (configs ECHConfigList) Equal(other ECHConfigList) bool
func (*ECHConfigList) FromBase64 ¶
func (configs *ECHConfigList) FromBase64(echConfigListBase64 string) error
func (ECHConfigList) MarshalBinary ¶
func (configs ECHConfigList) MarshalBinary() ([]byte, error)
func (ECHConfigList) ToBase64 ¶
func (configs ECHConfigList) ToBase64() (string, error)
func (ECHConfigList) ToBase64OrPanic ¶
func (configs ECHConfigList) ToBase64OrPanic() string
func (*ECHConfigList) UnmarshalBinary ¶
func (configs *ECHConfigList) UnmarshalBinary(data []byte) error
type ECHKeySet ¶
type ECHKeySet struct { PrivateKey kem.PrivateKey ECHConfig ECHConfig }
func GenerateECHKeySet ¶
func (*ECHKeySet) FromBase64 ¶
func (*ECHKeySet) MarshalBinary ¶
len - privatekey - len - config
func (*ECHKeySet) ToBase64OrPanic ¶
func (*ECHKeySet) UnmarshalBinary ¶
type ECHKeySetList ¶
type ECHKeySetList []ECHKeySet
func ECHKeySetListFromBase64 ¶
func ECHKeySetListFromBase64(echKeySetListBase64 string) (ECHKeySetList, error)
func UnmarshalECHKeySetList ¶
func UnmarshalECHKeySetList(data []byte) (ECHKeySetList, error)
func (ECHKeySetList) Equal ¶
func (keysets ECHKeySetList) Equal(other ECHKeySetList) bool
func (*ECHKeySetList) FromBase64 ¶
func (keysets *ECHKeySetList) FromBase64(keySetListBase64 string) error
func (ECHKeySetList) MarshalBinary ¶
func (keysets ECHKeySetList) MarshalBinary() ([]byte, error)
func (ECHKeySetList) ToBase64 ¶
func (keysets ECHKeySetList) ToBase64() (string, error)
func (ECHKeySetList) ToBase64OrPanic ¶
func (keysets ECHKeySetList) ToBase64OrPanic() string
func (*ECHKeySetList) UnmarshalBinary ¶
func (keysets *ECHKeySetList) UnmarshalBinary(data []byte) error
type HpkeSymmetricCipherSuite ¶
func (HpkeSymmetricCipherSuite) String ¶
func (cipherSuite HpkeSymmetricCipherSuite) String() string
type InvalidAEADError ¶
type InvalidAEADError uint16
func (InvalidAEADError) Error ¶
func (aead InvalidAEADError) Error() string
type InvalidKDFError ¶
type InvalidKDFError uint16
func (InvalidKDFError) Error ¶
func (kdf InvalidKDFError) Error() string
type InvalidKEMError ¶
type InvalidKEMError uint16
func (InvalidKEMError) Error ¶
func (kem InvalidKEMError) Error() string
type InvalidPublicNameLenError ¶
type InvalidPublicNameLenError uint
func (InvalidPublicNameLenError) Error ¶
func (length InvalidPublicNameLenError) Error() string
Click to show internal directories.
Click to hide internal directories.