keys

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0, ISC Imports: 5 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHParams

type DHParams struct {
	Prime         *big.Int
	Generator     *big.Int
	ServerPublic  *big.Int
	ServerPrivate *big.Int
	ClientPublic  *big.Int
	ClientPrivate *big.Int
	SessionKey    *big.Int
}

DHParams can be used to store finite-field Diffie-Hellman parameters. At any point in time, it is unlikely that both OurPrivate and TheirPrivate will be non-nil.

func (*DHParams) MarshalJSON

func (p *DHParams) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshal interface

func (*DHParams) UnmarshalJSON

func (p *DHParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implement the json.Unmarshaler interface

type ECDHParams

type ECDHParams struct {
	TLSCurveID    TLSCurveID         `json:"curve_id,omitempty"`
	Curve         elliptic.Curve     `json:"-"`
	ServerPublic  *ECPoint           `json:"server_public,omitempty"`
	ServerPrivate *ECDHPrivateParams `json:"server_private,omitempty"`
	ClientPublic  *ECPoint           `json:"client_public,omitempty"`
	ClientPrivate *ECDHPrivateParams `json:"client_private,omitempty"`
}

ECDHParams stores elliptic-curve Diffie-Hellman paramters.At any point in time, it is unlikely that both ServerPrivate and ClientPrivate will be non-nil.

type ECDHPrivateParams

type ECDHPrivateParams struct {
	Value  []byte `json:"value,omitempty"`
	Length int    `json:"length,omitempty"`
}

type ECPoint

type ECPoint struct {
	X *big.Int
	Y *big.Int
}

ECPoint represents an elliptic curve point and serializes nicely to JSON

func (*ECPoint) MarshalJSON

func (p *ECPoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshler interface

func (*ECPoint) UnmarshalJSON

func (p *ECPoint) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshler interface

type RSAClientParams

type RSAClientParams struct {
	Length       uint16 `json:"length,omitempty"`
	EncryptedPMS []byte `json:"encrypted_pre_master_secret,omitempty"`
}

type RSAPublicKey

type RSAPublicKey struct {
	*rsa.PublicKey
}

func (*RSAPublicKey) MarshalJSON

func (rp *RSAPublicKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshal interface

func (*RSAPublicKey) UnmarshalJSON

func (rp *RSAPublicKey) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshal interface

type TLSCurveID

type TLSCurveID uint16

TLSCurveID is the type of a TLS identifier for an elliptic curve. See http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8

const (
	Sect163k1       TLSCurveID = 1
	Sect163r1       TLSCurveID = 2
	Sect163r2       TLSCurveID = 3
	Sect193r1       TLSCurveID = 4
	Sect193r2       TLSCurveID = 5
	Sect233k1       TLSCurveID = 6
	Sect233r1       TLSCurveID = 7
	Sect239k1       TLSCurveID = 8
	Sect283k1       TLSCurveID = 9
	Sect283r1       TLSCurveID = 10
	Sect409k1       TLSCurveID = 11
	Sect409r1       TLSCurveID = 12
	Sect571k1       TLSCurveID = 13
	Sect571r1       TLSCurveID = 14
	Secp160k1       TLSCurveID = 15
	Secp160r1       TLSCurveID = 16
	Secp160r2       TLSCurveID = 17
	Secp192k1       TLSCurveID = 18
	Secp192r1       TLSCurveID = 19
	Secp224k1       TLSCurveID = 20
	Secp224r1       TLSCurveID = 21
	Secp256k1       TLSCurveID = 22
	Secp256r1       TLSCurveID = 23
	Secp384r1       TLSCurveID = 24
	Secp521r1       TLSCurveID = 25
	BrainpoolP256r1 TLSCurveID = 26
	BrainpoolP384r1 TLSCurveID = 27
	BrainpoolP512r1 TLSCurveID = 28
)

IANA-assigned curve ID values, see http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8

func (*TLSCurveID) Description

func (c *TLSCurveID) Description() string

Description returns the description field for the given ID. See http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8

func (*TLSCurveID) MarshalJSON

func (c *TLSCurveID) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*TLSCurveID) UnmarshalJSON

func (c *TLSCurveID) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

Jump to

Keyboard shortcuts

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