ecdsa

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(prvKey *ecdsa.PrivateKey, peersPubKey *ecdsa.PublicKey, ciphertext []byte) ([]byte, error)

func Encrypt

func Encrypt(peersPubKey *ecdsa.PublicKey, message []byte) ([]byte, *ecdsa.PublicKey, error)

func Sign

func Sign(prvKey *ecdsa.PrivateKey, message []byte) ([]byte, error)

func Verify

func Verify(pubKey *ecdsa.PublicKey, message, sig []byte) bool

Types

type Envelope

type Envelope struct {
	Type          string `json:"type"`
	ShareKey      string `json:"key"`
	RecverAuthKey string `json:"dest"`
	TempAuthKey   string `json:"pubkey"`
}

func Unmarshal

func Unmarshal(envelopeMap map[string]interface{}) Envelope

func (Envelope) GetDest

func (a Envelope) GetDest() string

type PrivateKey

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

func NewPrivateKey

func NewPrivateKey(prvKey ecdsa.PrivateKey) *PrivateKey

func (PrivateKey) ExtractShareKey

func (p PrivateKey) ExtractShareKey(envelope caesar.Envelope) ([]byte, error)

func (PrivateKey) GetAuthKey

func (p PrivateKey) GetAuthKey() (string, error)

func (PrivateKey) Sign

func (p PrivateKey) Sign(message []byte) ([]byte, error)

type PublicKey

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

func NewPublicKey

func NewPublicKey(pubKey ecdsa.PublicKey, sshPubKey ssh.PublicKey) *PublicKey

func (PublicKey) GetAuthKey

func (p PublicKey) GetAuthKey() string

func (PublicKey) NewEnvelope

func (p PublicKey) NewEnvelope(shareKey []byte) (caesar.Envelope, error)

func (PublicKey) Verify

func (p PublicKey) Verify(message, sig []byte) bool

Jump to

Keyboard shortcuts

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