Documentation ¶
Index ¶
- Variables
- func GenerateSignature(data []byte, identity *identity.FullIdentity) ([]byte, error)
- func GetAPIKey(ctx context.Context) ([]byte, bool)
- func SignMessage(msg SignableMessage, ID identity.FullIdentity) error
- func ValidateAPIKey(ctx context.Context, actualKey []byte) error
- func VerifyMsg(msg SignableMessage, signer storj.NodeID) error
- func WithAPIKey(ctx context.Context, key []byte) context.Context
- type SignableMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrSign indicates a failure during signing ErrSign = errs.Class("Failed to sign message") //ErrVerify indicates a failure during signature validation ErrVerify = errs.Class("Failed to validate message signature") //ErrSigLen indicates an invalid signature length ErrSigLen = errs.Class("Invalid signature length") //ErrSerial indicates an invalid serial number length ErrSerial = errs.Class("Invalid SerialNumber") //ErrExpired indicates the agreement is expired ErrExpired = errs.Class("Agreement is expired") //ErrSigner indicates a public key / node id mismatch ErrSigner = errs.Class("Message public key did not match expected signer") //ErrBadID indicates a public key / node id mismatch ErrBadID = errs.Class("Node ID did not match expected id") //ErrMarshal indicates a failure during serialization ErrMarshal = errs.Class("Could not marshal item to bytes") //ErrUnmarshal indicates a failure during deserialization ErrUnmarshal = errs.Class("Could not unmarshal bytes to item") //ErrMissing indicates missing or empty information ErrMissing = errs.Class("Required field is empty") )
View Source
var Error = errs.Class("auth error")
Error is the default auth error class
Functions ¶
func GenerateSignature ¶
func GenerateSignature(data []byte, identity *identity.FullIdentity) ([]byte, error)
GenerateSignature creates signature from identity id
func SignMessage ¶
func SignMessage(msg SignableMessage, ID identity.FullIdentity) error
SignMessage adds the crypto-related aspects of signed message
func ValidateAPIKey ¶
ValidateAPIKey compares the context api key with the key passed in as an argument
Types ¶
Click to show internal directories.
Click to hide internal directories.