cryptoRSA

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func GenerateToken(userID string, now int64, secretKey interface{}) (string, error)

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

func ParseRSAPublicKey(publicKeyData []byte) (*rsa.PublicKey, error)

create secret key RSA openssl genrsa 4096 > secret.key create public key RSA openssl rsa -pubout < secret.key > public.key 公開鍵の読み込み (RSA)

func PemDecoder

func PemDecoder(data []byte) (*pem.Block, error)

func VerifyToken

func VerifyToken(token string, publicKey interface{}) (*jwt.Token, error)

publicKey = *rsa.PublicKey VerifyToken

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL