webpush

package
v0.0.0-...-5f56102 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSecret

func CalculateSecret(sp *KeyPair, rp *KeyPair) []byte

CalculateSecret calculates the shared secret between the two KeyPairs using ECDH.

Types

type KeyPair

type KeyPair struct {
	PublicKey []byte
	// contains filtered or unexported fields
}

KeyPair contains the public and private keys.

func (*KeyPair) GenerateKeys

func (k *KeyPair) GenerateKeys() error

GenerateKeys generates a fresh P-256 keypair.

func (*KeyPair) SetPrivateKey

func (k *KeyPair) SetPrivateKey(privateKey []byte) error

SetPrivateKey sets the private key part of the KeyPair.

func (*KeyPair) SetPublicKey

func (k *KeyPair) SetPublicKey(publicKey []byte) error

SetPublicKey sets the public key part of the KeyPair. This should be an uncompressed NIST P-256 point.

Jump to

Keyboard shortcuts

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