Documentation ¶
Overview ¶
Package keyauth provides very simple knowledge proof for curve25519 private key belonging to shared public key
Index ¶
- Constants
- func Answer(challenge *[ChallengeSize]byte, secret *[PrivateKeySize]byte) *[AnswerSize]byte
- func GenTempKey(secret *[PrivateKeySize]byte) (privateKey *[PrivateKeySize]byte, publicKey *[PublicKeySize]byte, ...)
- func GenTempKeyTime(time uint64, secret *[PrivateKeySize]byte) (privateKey *[PrivateKeySize]byte, publicKey *[PublicKeySize]byte, ...)
- func Verify(answer *[AnswerSize]byte, secret *[PrivateKeySize]byte, ...) bool
- func VerifyTime(answer *[AnswerSize]byte, now, timeRange uint64) bool
- func VerifyTimeNow(answer *[AnswerSize]byte, timeRange uint64) bool
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.
Click to show internal directories.
Click to hide internal directories.