Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SignatureHeaderKey defines header carrying the signature
SignatureHeaderKey = "Signature"
)
Variables ¶
View Source
var ( // ErrorMissingHeader is returned when a header used in the canonical request representation is missing ErrorMissingHeader = errors.New("signable payload can not be generated since a relevant header is missing") )
Definition of error cases
Functions ¶
func Sign ¶
func Sign(privateKey ed25519.PrivateKey, message []byte) []byte
Sign signs the message with privateKey and returns a signature. It will panic if len(privateKey) is not PrivateKeySize
func SignablePayload ¶
func SignablePayload(method string, scheme string, host string, requestURI string, headers http.Header, body []byte) ([]byte, error)
SignablePayload builds the payload which can be signed Method\r\nHost\r\nRequestURI\r\nDate Header Value\r\nBody Example: (method):-method-\r\n(url):-scheme-://-host--requestURI-\r\n(Date):Wed, 07 Oct 2020 10:00:00 GMT\r\n(body):{\"hello\":\"world\"}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.