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
Click to show internal directories.
Click to hide internal directories.