Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeString2Key ¶
func DecodeString2Key(pemPri, pemPub string) (priKey *ecdsa.PrivateKey, pubKey *ecdsa.PublicKey)
DecodeString2Key can decode string to pri/pub key
func EncodeKey2String ¶
func EncodeKey2String(pri *ecdsa.PrivateKey, pub *ecdsa.PublicKey) (priKeyStr, pubKeyStr string)
EncodeKey2String can encode pri/pub key to string
func GenerateJWT ¶
GenerateJWT is to generate JWT. using ES256. However, this function cannot generate the whole JWT(include head, payload and sign). Only head and payload. Sign part need jwt.Sign to append. After calling jwt.Sign, Sign function return []byte(have processed through base64). Just need to string(what jwt.Sign return).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.