ed

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K

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

func Generate

func Generate() (k *K, err error)

Generate - generates a new ED255 public/private key

func New

func New(rkey interface{}) (k *K, err error)

New - converts a raw key interface into instance of ED25519

func (*K) Bytes

func (k *K) Bytes() (bytes []byte, err error)

Bytes - returns JSON encoded bytes of the key

func (*K) IsPrivateKey

func (k *K) IsPrivateKey() (p bool)

IsPrivateKey - returns if K is a private key instance

func (*K) IsPublicKey

func (k *K) IsPublicKey() (p bool)

IsPublicKey - returns if K is a public key instance

func (*K) KeyType

func (k *K) KeyType() (kt shared.KeyType)

KeyType - returns key type

func (K) MarshalJSON added in v2.0.3

func (k K) MarshalJSON() (bytes []byte, err error)

MarshalJSON - marshals this Key into a JSON

func (*K) PrivateKeyInstance

func (k *K) PrivateKeyInstance() (privkey interface{})

PrivateKeyInstance - returns actual instance of private key of type

func (*K) PublicKey

func (k *K) PublicKey() (kPub shared.Key, err error)

PublicKey - returns instance of public key of type Key extracted from private key

func (*K) PublicKeyInstance

func (k *K) PublicKeyInstance() (pubkey interface{})

PublicKeyInstance - returns actual instance of public key of type

func (*K) Sign

func (k *K) Sign(hashed []byte) (signed []byte, err error)

Sign - signs the given hashed data using the ED25519 private key

func (*K) String

func (k *K) String() (str string)

String - returns JSON encoded string of the key

func (*K) Verify

func (k *K) Verify(signed []byte, hashed []byte) (ok bool)

Verify - verifies the signed data of the given hashed data using the ED25519 public key

Jump to

Keyboard shortcuts

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