identity

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalEd25519PrivateKey

func MarshalEd25519PrivateKey(sk crypto.PrivateKey) ([]byte, error)

MarshalEd25519PrivateKey returns a DER encoding of the input private key as specified in https://tools.ietf.org/html/draft-ietf-curdle-pkix-04.

func MarshalEd25519PublicKey

func MarshalEd25519PublicKey(pk crypto.PublicKey) ([]byte, error)

MarshalEd25519PublicKey creates a DER-encoded SubjectPublicKeyInfo for an ed25519 public key, as defined in https://tools.ietf.org/html/draft-ietf-curdle-pkix-04. This is analogous to MarshalPKIXPublicKey in crypto/x509, which doesn't currently support Ed25519.

func ParseEd25519PrivateKey

func ParseEd25519PrivateKey(der []byte) (crypto.PrivateKey, error)

ParseEd25519PrivateKey returns the Ed25519 private key encoded by the input.

func ParseEd25519PublicKey

func ParseEd25519PublicKey(der []byte) (crypto.PublicKey, error)

ParseEd25519PublicKey returns the Ed25519 public key encoded by the input.

Types

type Identity

type Identity struct {
	Anonymous bool
	PriKey    ed25519.PrivateKey
	PubKey    crypto.PublicKey
}

func New

func New(anonymous bool, pkBytes []byte) *Identity

func (*Identity) PubKeyBytes

func (identity *Identity) PubKeyBytes() []byte

func (*Identity) Sign

func (identity *Identity) Sign(m []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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