Documentation ¶
Index ¶
- Variables
- func LoadOrCreateIdentityPrivateKey(identityFilePath string, identityPrivKey string) (ed25519.PrivateKey, bool, error)
- func ParseEd25519PrivateKeyFromString(identityPrivKey string) (ed25519.PrivateKey, error)
- func ReadEd25519PrivateKeyFromPEMFile(filepath string) (ed25519.PrivateKey, error)
- func WriteEd25519PrivateKeyToPEMFile(filepath string, privateKey ed25519.PrivateKey) error
- type Auth
- type AuthClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPrivKeyInvalid = errors.New("invalid private key") ErrNoPrivKeyFound = errors.New("no private key found") )
View Source
var (
ErrJWTInvalidClaims = echo.NewHTTPError(http.StatusUnauthorized, "invalid jwt claims")
)
Errors.
Functions ¶
func LoadOrCreateIdentityPrivateKey ¶
func LoadOrCreateIdentityPrivateKey(identityFilePath string, identityPrivKey string) (ed25519.PrivateKey, bool, error)
LoadOrCreateIdentityPrivateKey loads an existing Ed25519 based identity private key or creates a new one and stores it as a PEM file in the identityFilePath.
func ParseEd25519PrivateKeyFromString ¶
func ParseEd25519PrivateKeyFromString(identityPrivKey string) (ed25519.PrivateKey, error)
ParseEd25519PrivateKeyFromString parses an Ed25519 private key from a hex encoded string.
func ReadEd25519PrivateKeyFromPEMFile ¶
func ReadEd25519PrivateKeyFromPEMFile(filepath string) (ed25519.PrivateKey, error)
ReadEd25519PrivateKeyFromPEMFile reads an Ed25519 private key from a file with PEM format.
func WriteEd25519PrivateKeyToPEMFile ¶
func WriteEd25519PrivateKeyToPEMFile(filepath string, privateKey ed25519.PrivateKey) error
WriteEd25519PrivateKeyToPEMFile stores an Ed25519 private key to a file with PEM format.
Types ¶
type Auth ¶ added in v1.0.0
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Middleware ¶ added in v1.0.0
func (j *Auth) Middleware(skipper middleware.Skipper, allow func(c echo.Context, subject string, claims *AuthClaims) bool) echo.MiddlewareFunc
type AuthClaims ¶
type AuthClaims struct {
jwt.StandardClaims
}
func (*AuthClaims) VerifySubject ¶
func (c *AuthClaims) VerifySubject(expected string) bool
Click to show internal directories.
Click to hide internal directories.