identity

package
Version: v0.0.0-...-7271f6c Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: MIT Imports: 10 Imported by: 3

Documentation

Overview

The identity package has methods and structures relating to methods of identification on the AirDispatch network including Signing Keys, Encryption Keys, Address Fingerprints, and more!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// The fingerprint of the address signingKey
	Fingerprint []byte
	// The location of the user's server
	Location string
	// The publicKey of the user
	EncryptionKey *rsa.PublicKey
	// The signingKey of the user
	SigningKey *ecdsa.PublicKey

	// Optional Alias of the Address
	Alias string
	// contains filtered or unexported fields
}

The address structure provides abstractions on AirDispatch addresses

var Public *Address = &Address{
	public: true,
}

The Public variable has an address that can represent sending a message to the public.

func CreateAddressFromBytes

func CreateAddressFromBytes(b []byte) *Address

func CreateAddressFromString

func CreateAddressFromString(addr string) *Address

func DecodeAddress

func DecodeAddress(b []byte) (*Address, error)

func (*Address) CanSend

func (a *Address) CanSend() bool

func (*Address) Encode

func (a *Address) Encode() ([]byte, error)

func (*Address) EqualsBytes

func (a *Address) EqualsBytes(addr []byte) bool

func (*Address) HasLocation

func (a *Address) HasLocation() bool

func (*Address) IsPublic

func (a *Address) IsPublic() bool

Compares the Address to the `Public Address`.

func (*Address) String

func (a *Address) String() string

The string representation of an Address is just the Fingerprint of that address.

type Identity

type Identity struct {
	Address       *Address
	EncryptionKey *rsa.PrivateKey
	SigningKey    *ecdsa.PrivateKey
}

The Identity structure is a complete AirDispatch user including Encryption and Signing private keys.

WARNING: This structure should be stored carefully as having access to this data will be enough to impersonate someone on the AirDispatch network.

func CreateIdentity

func CreateIdentity() (id *Identity, err error)

This creates a new random, AirDispatch Identity

func GobDecodeKey

func GobDecodeKey(buffer io.Reader) (*Identity, error)

This function loads a Gob-Encoded ADKey from a buffer

func LoadKeyFromFile

func LoadKeyFromFile(filename string) (*Identity, error)

This function Loads an Airdispatch Key from a File

func (*Identity) GobEncodeKey

func (a *Identity) GobEncodeKey(buffer io.Writer) (io.Writer, error)

This function writes a Gob-Encoded ADKey to a buffer

func (*Identity) PopulateAddress

func (a *Identity) PopulateAddress()

func (*Identity) SaveKeyToFile

func (a *Identity) SaveKeyToFile(filename string) error

This function Saves an Airdispatch Key to a File

func (*Identity) SetLocation

func (a *Identity) SetLocation(newLocation string)

func (*Identity) SignBytes

func (a *Identity) SignBytes(payload []byte) (*wire.Signature, error)

This function signs a series of bytes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL