Documentation ¶
Index ¶
- Variables
- func GenerateSignature(ctx context.Context, data []byte, identity *identity.FullIdentity) (_ []byte, err error)
- func GetAPIKey(ctx context.Context) ([]byte, bool)
- func SignMessage(ctx context.Context, msg SignableMessage, ID identity.FullIdentity) (err error)
- func ValidateAPIKey(ctx context.Context, actualKey []byte) (err error)
- func VerifyMsg(ctx context.Context, msg SignableMessage, signer storj.NodeID) (err 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(ctx context.Context, data []byte, identity *identity.FullIdentity) (_ []byte, err error)
GenerateSignature creates signature from identity id
func SignMessage ¶
func SignMessage(ctx context.Context, msg SignableMessage, ID identity.FullIdentity) (err 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.