simpleAuth

package module
v0.0.0-...-63c6cee Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2013 License: BSD-3-Clause Imports: 7 Imported by: 0

README

simple-auth

Simple authentication

Far from complete and currently insecure. I will be developing this in my spare time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

func NewConsumer

func NewConsumer(priv string) *Consumer

func (*Consumer) Encode

func (c *Consumer) Encode(data string) string

Encode String

type Provider

type Provider struct {
	Storage
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(db Storage, publicSize, privateSize int) *Provider

func (*Provider) Create

func (p *Provider) Create(data interface{}) (string, string, interface{}, error)

create new api public and private keys and assign them data

func (*Provider) Verify

func (p *Provider) Verify(pubKey, reqData, hexMAC string) (interface{}, error)

verify that public key matches with encoded data and return public key, private key and data eventually check time

type Storage

type Storage interface {
	// set public key, private key and data
	Set(string, string, interface{}) error
	// get public key, private key and data given a public key
	Get(string) (string, string, interface{}, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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