Documentation
¶
Overview ¶
Package keyproof implements a simple authentication system based on ed25519 signatures Alice sends a token to Bob that authenticates Alice to Bob and contains time information Bob then verifies and counter-signs the token and sends it back to Alice Alice verifies the original token, the counter-signature and the timing information and grants access or denies it
Index ¶
- Constants
- func CounterSignToken(proof *[ProofTokenSize]byte, recPubKey *[ed25519.PublicKeySize]byte, ...) (bool, *[ProofTokenSignedSize]byte)
- func SignProofToken(time int64, recPubkey, sendPubkey *[ed25519.PublicKeySize]byte, ...) *[ProofTokenSize]byte
- func VerifyCounterSig(counterSig *[ProofTokenSignedSize]byte, ...) (bool, int64)
- func VerifyProofToken(proof *[ProofTokenSize]byte, recPubkeyTest *[ed25519.PublicKeySize]byte) (bool, int64, *[ed25519.PublicKeySize]byte)
Constants ¶
const ProofTokenMax = 186
ProofTokenMax is the maximum size of a base58 encoded ProofToken
const ProofTokenSignedMax = 274
ProofTokenSignedMax is the maximum size of a base58 encoded signed prooftoken
const ProofTokenSignedSize = ProofTokenSize + ed25519.SignatureSize
ProofTokenSignedSize is the length of a counter-signed prooftoken
const ProofTokenSize = ed25519.PublicKeySize + 8 + ed25519.PublicKeySize + ed25519.SignatureSize
ProofTokenSize is the length of a proof token
const Version = "0.0.1 very alpha"
Version of this release
Variables ¶
This section is empty.
Functions ¶
func CounterSignToken ¶
func CounterSignToken(proof *[ProofTokenSize]byte, recPubKey *[ed25519.PublicKeySize]byte, recPrivKey *[ed25519.PrivateKeySize]byte) (bool, *[ProofTokenSignedSize]byte)
CounterSignToken creates a counter-signature for token recPubKey is the public key of Bob. Returns true/false and the countersigned prooftoken
func SignProofToken ¶
func SignProofToken(time int64, recPubkey, sendPubkey *[ed25519.PublicKeySize]byte, sendPrivKey *[ed25519.PrivateKeySize]byte) *[ProofTokenSize]byte
SignProofToken generates a signproof recPubkey is Bob's public key, sendPubkey and sendPrivkey are Alice's. time is the timestamp to embed returns the prooftoken
func VerifyCounterSig ¶
func VerifyCounterSig(counterSig *[ProofTokenSignedSize]byte, sendPubkey *[ed25519.PublicKeySize]byte) (bool, int64)
VerifyCounterSig verifies that a counter signature is valid sendPubkey is the public key of Alice. Returns true/false and embedded timestamp
func VerifyProofToken ¶
func VerifyProofToken(proof *[ProofTokenSize]byte, recPubkeyTest *[ed25519.PublicKeySize]byte) (bool, int64, *[ed25519.PublicKeySize]byte)
VerifyProofToken verifies a proof and returns the sender's public key recPubkeyTest is Bob's public key. Returns true/false, the embeded timestamp and Alice's pubkey
Types ¶
This section is empty.