tls

package
v0.0.0-...-9aed184 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: 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 ObjID

type ObjID struct {
	ObjID asn1.ObjectIdentifier
}

ObjID is a asn1.ObjectIdentifier place holder

type X25519

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

X25519 is curve25519 storage item

func NewX25519

func NewX25519() *X25519

NewX25519 create a curve25519

func (*X25519) PEMPublicKey

func (x *X25519) PEMPublicKey() string

PEMPublicKey return a string public key

func (*X25519) ParsePEMPrivateKey

func (x *X25519) ParsePEMPrivateKey(privatePEMKey string) error

ParsePEMPrivateKey parse a private key from string

func (*X25519) ParsePrivateKey

func (x *X25519) ParsePrivateKey(privateKey []byte) error

ParsePrivateKey parse private form a byte array

func (*X25519) ParseRandomPrivateKey

func (x *X25519) ParseRandomPrivateKey() error

ParseRandomPrivateKey user an random . which from /dev/urandom on Unix-like system

func (*X25519) PublicKey

func (x *X25519) PublicKey() []byte

PublicKey return a byte array public key

func (*X25519) SharedKey

func (x *X25519) SharedKey(peerPublicKey []byte) (sharedKey []byte, err error)

SharedKey return sharedkey for the two curve25519

Jump to

Keyboard shortcuts

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