Documentation ¶
Index ¶
- Variables
- func GenerateToken(userID string, now int64, secretKey interface{}) (string, error)
- func ParseRSAPrivateKey(privateKeyData []byte) (*rsa.PrivateKey, error)
- func ParseRSAPublicKey(publicKeyData []byte) (*rsa.PublicKey, error)
- func PemDecoder(data []byte) (*pem.Block, error)
- func VerifyToken(token string, publicKey interface{}) (*jwt.Token, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // "invalid data" ErrInvalidData = "invalid data" // "invalid key data" ErrInvalidKey = "invalid key data" // "key cannot decode" ErrDecode = "key cannot decode" // "type error" ErrType = "type error" )
Functions ¶
func GenerateToken ¶
claims の変更できる example generate token and claims
func ParseRSAPrivateKey ¶
func ParseRSAPrivateKey(privateKeyData []byte) (*rsa.PrivateKey, error)
create secret key RSA openssl genrsa 4096 > secret.key create public key RSA openssl rsa -pubout < secret.key > public.key 秘密鍵の読み込み (RSA)
func ParseRSAPublicKey ¶
create secret key RSA openssl genrsa 4096 > secret.key create public key RSA openssl rsa -pubout < secret.key > public.key 公開鍵の読み込み (RSA)
func VerifyToken ¶
publicKey = *rsa.PublicKey VerifyToken
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.