registration

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 7 Imported by: 5

Documentation

Overview

Package registration contains functions for generating data for registration. This includes base key and user ID generation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientHMAC

func CreateClientHMAC(sessionKey, encryptedKey []byte,
	h func() hash.Hash) []byte

CreateClientHMAC constructs an HMAC on the encrypted client key.

func GenerateBaseKey

func GenerateBaseKey(g *cyclic.Group, peerPubKey *cyclic.Int,
	ownPrivKey *cyclic.Int, h hash.Hash) *cyclic.Int

GenerateBaseKey generates a Base Key from DHKX using RSA Keys g is the group used in RSA peerPubKey is the RSA PublicKey of the peer ownPrivKey is the RSA PrivateKey of the caller h is the hash to be used on the DHKX sessionKey Returns base key to be used in CMIX

func SignWithTimestamp

func SignWithTimestamp(rand io.Reader, priv *rsa.PrivateKey,
	timestampNano int64, userPubKeyPem string) ([]byte, error)

SignWithTimestamp signs a hash of the timestamp and the user's public key

func VerifyClientHMAC

func VerifyClientHMAC(sessionKey, encryptedKey []byte,
	h func() hash.Hash, receivedHmac []byte) bool

VerifyClientHMAC checks if the hmac received matches the values received.

func VerifyWithTimestamp

func VerifyWithTimestamp(serverPubKey *rsa.PublicKey,
	timestampNano int64, userPubKeyPem string, sig []byte) error

VerifyWithTimestamp verifies the signature provided against serverPubKey and the digest of the timestamp ts and userPubKey

Types

This section is empty.

Jump to

Keyboard shortcuts

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