json

package
v0.0.0-...-b578434 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0, ISC, MIT Imports: 5 Imported by: 0

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"`
}

ECDHPrivateParams are the TLS key exchange parameters for ECDH keys.

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"`
}

RSAClientParams are the TLS key exchange parameters for RSA keys.

type RSAPublicKey

type RSAPublicKey struct {
	*rsa.PublicKey
}

RSAPublicKey provides JSON methods for the standard 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