Last active
August 1, 2016 08:41
-
-
Save ivajloip/3d227d64b004b77a4d449e8cd6e1d1ad to your computer and use it in GitHub Desktop.
jwt secret obtaining
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var privateKey *rsa.PrivateKey | |
var err error | |
if autogenerate { | |
if privateKey, err = rsa.GenerateKey(rand.Reader, 4096); err != nil { | |
log.Fatal("No jwt secret provided for token generation and auto-generation failed") | |
} | |
} else if privateKey, err = jwt.ParseRSAPrivateKeyFromPEM(privateKeyBytes); err != nil { | |
log.Fatal("Could not parse data from jwt secret") | |
} | |
publicKey := &privateKey.PublicKey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment