Documentation ¶
Index ¶
- func BuildJWT(subject string, ttl time.Duration, privateKey []byte) (token string, err error)
- func GenerateCert(location string, hostnames ...string) error
- func GenerateKeypair(location string) error
- func LoadCert(location string) (cert []byte, err error)
- func LoadKeypair(location string) (*ecdsa.PrivateKey, error)
- func PrivatePEM(key *ecdsa.PrivateKey) ([]byte, error)
- func PublicPEM(key *ecdsa.PrivateKey) ([]byte, error)
- func ValidateJWT(token string, publicKey []byte) (*jwt.StandardClaims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildJWT ¶
BuildJWT builds a JSON Web Token for the given subject and ttl, and signs it with the given private key
func GenerateCert ¶
GenerateCert generates a certificate for the given hostnames in the given location
func GenerateKeypair ¶
GenerateKeypair generates a new keypair in the given location
func LoadKeypair ¶
func LoadKeypair(location string) (*ecdsa.PrivateKey, error)
LoadKeypair loads the keypair in the given location
func PrivatePEM ¶
func PrivatePEM(key *ecdsa.PrivateKey) ([]byte, error)
PrivatePEM returns the PEM-encoded private key
func PublicPEM ¶
func PublicPEM(key *ecdsa.PrivateKey) ([]byte, error)
PublicPEM returns the PEM-encoded public key
func ValidateJWT ¶
ValidateJWT validates a JSON Web Token with the given public key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.