sign

package
v0.0.0-...-fefa4f9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySignedBody

func VerifySignedBody(s *SignedBody, publicKey *rsa.PublicKey, v any) error

VerifySignedBody will populate v with the contents of Body, if the signature is verified with regards to the public key provided

Types

type SignedBody

type SignedBody struct {
	Signature string `json:"signature"`
	Algo      string `json:"algo"`
	Body      string `json:"body"`
}

SignedBody provides a uniform, signed object that can be returned by services that need to provide proof of work

func NewSignedBody

func NewSignedBody(v any, privateKey *rsa.PrivateKey) (*SignedBody, error)

NewSignedBody returns an instance of SignedBody, marshalling the provided object to JSON and then signing with the key

func (SignedBody) String

func (s SignedBody) String() string

Jump to

Keyboard shortcuts

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