airdispatch-go: github.com/airdispatch/airdispatch-go/identity Index | Files

package identity

import "github.com/airdispatch/airdispatch-go/identity"

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

Package Files

address.go fs.go identity.go

type Address Uses

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 Uses

func CreateAddressFromBytes(b []byte) *Address

func CreateAddressFromString Uses

func CreateAddressFromString(addr string) *Address

func DecodeAddress Uses

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

func (*Address) CanSend Uses

func (a *Address) CanSend() bool

func (*Address) Encode Uses

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

func (*Address) EqualsBytes Uses

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

func (*Address) HasLocation Uses

func (a *Address) HasLocation() bool

func (*Address) IsPublic Uses

func (a *Address) IsPublic() bool

Compares the Address to the `Public Address`.

func (*Address) String Uses

func (a *Address) String() string

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

type Identity Uses

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 Uses

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

This creates a new random, AirDispatch Identity

func GobDecodeKey Uses

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

This function loads a Gob-Encoded ADKey from a buffer

func LoadKeyFromFile Uses

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

This function Loads an Airdispatch Key from a File

func (*Identity) GobEncodeKey Uses

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

This function writes a Gob-Encoded ADKey to a buffer

func (*Identity) PopulateAddress Uses

func (a *Identity) PopulateAddress()

func (*Identity) SaveKeyToFile Uses

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

This function Saves an Airdispatch Key to a File

func (*Identity) SetLocation Uses

func (a *Identity) SetLocation(newLocation string)

func (*Identity) SignBytes Uses

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

This function signs a series of bytes

Package identity imports 10 packages (graph). Updated 2016-07-15. Refresh now. Tools for package owners.