package
0.0.0-20231116081957-bc579e3d8a7d
Repository: https://github.com/kripsy/gophkeeper.git
Documentation: pkg.go.dev

# Functions

BuildJWTString creates a JWT token with the specified user information and secret key.
CreateCertificate generates an RSA certificate and saves it to the specified paths.
Decrypt decrypts the provided data using AES-GCM with the given cipher key.
DeriveKey generates a cryptographic key from the provided password and salt using scrypt algorithm.
Encrypt encrypts the provided data using AES-GCM with the given cipher key.
ExtractPartNumber extracts the part number from a given object name.
ExtractTokenFromContext retrieves the JWT token from the provided context.
ExtractUserIDFromContext retrieves the user ID from the provided context.
ExtractUsernameFromContext retrieves the username from the provided context.
FromUser2BucketName generates a bucket name based on the provided username and user ID.
GetHash generates a bcrypt hash of the provided password.
GetUseIDFromToken extracts the user ID from the provided JWT token.
GetUsernameFromToken extracts the username from the provided JWT token.
IsPasswordCorrect compares a plaintext password with a hashed password.
IsValidToken validates the provided JWT token using the secret key.

# Constants

Constants for various keys and prefixes used in the package.
Constants for various keys and prefixes used in the package.
Constants for various keys and prefixes used in the package.
Constants for various keys and prefixes used in the package.
Constants for various keys and prefixes used in the package.

# Variables

ErrCipherTextShort is an error returned when the provided ciphertext for decryption is shorter than expected.
Predefined errors for validation failures in utility functions.
Predefined errors for validation failures in utility functions.
Predefined errors for validation failures in utility functions.

# Structs

Claims struct defines the custom claims for JWT tokens, including the user's ID and username.