records

package
v0.0.0-...-84e837c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePublicScoreHash

func GeneratePublicScoreHash(score int, nonce string) []byte

Types

type CreditScoreRecord

type CreditScoreRecord struct {
	Reason string
	Score  int
	// leave empty for encryption
	Nonce string
	// leave empty for encryption
	ScoreHash []byte
}

Decrypted CreditScoreRecord

func (*CreditScoreRecord) Encrypt

func (c *CreditScoreRecord) Encrypt(publicKeyHex string) (*EncryptedCreditScoreRecord, error)

Encrypt encrypts a credit score record using the given public key.

type EncryptedCreditScoreRecord

type EncryptedCreditScoreRecord struct {
	Reason    string
	Score     string
	Nonce     string
	ScoreHash string
}

EncrytedCreditScoreRecord is the encrypted credit score record.

func (*EncryptedCreditScoreRecord) Decrypt

func (e *EncryptedCreditScoreRecord) Decrypt(privateKeyHex string) (*CreditScoreRecord, error)

Decrypt decrypts a credit score record using the given private key.

Jump to

Keyboard shortcuts

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