keyauth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: BSD-2-Clause Imports: 4 Imported by: 4

Documentation

Overview

Package keyauth provides very simple knowledge proof for curve25519 private key belonging to shared public key.

Index

Constants

View Source
const (
	// PublicKeySize .
	PublicKeySize = 32
	// PrivateKeySize .
	PrivateKeySize = 32
	// ChallengeSize is the size of a challenge
	ChallengeSize = PublicKeySize + 8
	// AnswerSize is the size of the answer to a challenge
	AnswerSize = PublicKeySize + ChallengeSize
)
View Source
const Version = "0.0.1 very alpha"

Version of this release

Variables

This section is empty.

Functions

func Answer

func Answer(challenge *[ChallengeSize]byte, secret *[PrivateKeySize]byte) *[AnswerSize]byte

Answer an authentication challenge. Secret is the private key belonging to the public key to be tested

func GenTempKey

func GenTempKey(secret *[PrivateKeySize]byte) (privateKey *[PrivateKeySize]byte, publicKey *[PublicKeySize]byte, challenge *[ChallengeSize]byte)

GenTempKey creates a temporary keypair for NOW

func GenTempKeyTime

func GenTempKeyTime(time uint64, secret *[PrivateKeySize]byte) (privateKey *[PrivateKeySize]byte, publicKey *[PublicKeySize]byte, challenge *[ChallengeSize]byte)

GenTempKeyTime generates a temporary keypair

func Verify

func Verify(answer *[AnswerSize]byte, secret *[PrivateKeySize]byte, testKey *[PublicKeySize]byte) bool

Verify an answer. secret is the own secret key, testKey is the public key to test ownership on

func VerifyTime

func VerifyTime(answer *[AnswerSize]byte, now, timeRange uint64) bool

VerifyTime verifies that the answer is still valid

func VerifyTimeNow

func VerifyTimeNow(answer *[AnswerSize]byte, timeRange uint64) bool

VerifyTimeNow calls VerifyTime for now

Types

This section is empty.

Jump to

Keyboard shortcuts

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