x25519

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateKeySize = curve25519.PointSize
	PublicKeySize  = curve25519.PointSize
)

Variables

View Source
var (
	OID             = asn1.ObjectIdentifier{1, 3, 101, 110}
	ErrBadOID       = errors.New("bad ASN.1 object identifier")
	ErrNotFound     = errors.New("no private key found")
	ErrSizeMismatch = errors.New("key size mismatch")
)

Functions

This section is empty.

Types

type PrivateKey

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

func NewPrivate

func NewPrivate(rand io.Reader) (k *PrivateKey, err error)

func (*PrivateKey) EncodePEM

func (k *PrivateKey) EncodePEM() (block *pem.Block, err error)

func (*PrivateKey) EncodePEMWithPassword

func (k *PrivateKey) EncodePEMWithPassword(rand io.Reader, password []byte, cipher x509.PEMCipher) (block *pem.Block, err error)

func (*PrivateKey) EncodePKCS8

func (k *PrivateKey) EncodePKCS8() ([]byte, error)

func (*PrivateKey) ParsePEM

func (k *PrivateKey) ParsePEM(data []byte) error

func (*PrivateKey) ParsePEMWithPassword

func (k *PrivateKey) ParsePEMWithPassword(data, password []byte) error

func (*PrivateKey) ParsePKCS8

func (k *PrivateKey) ParsePKCS8(der []byte) error

func (*PrivateKey) PrivateKey

func (k *PrivateKey) PrivateKey() []byte

func (*PrivateKey) PublicKey

func (k *PrivateKey) PublicKey() []byte

func (*PrivateKey) SetBytes

func (k *PrivateKey) SetBytes(data []byte) *PrivateKey

func (*PrivateKey) SharedKey

func (k *PrivateKey) SharedKey(peer []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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