Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeypair ¶
GenerateKeypair generates a public and private ECDSA key, to be used for signing and verifying authentication tokens.
func KeypairExists ¶
KeypairExists checks if keypair exists already
func TokenExpired ¶
Given a token verifies if it has already expired or not return true if token has expired, false otherwise.
Types ¶
type AuthToken ¶
type AuthToken struct { Username string Groups []string Assertions map[string]string Expiration int64 }
AuthToken contains information about the authenticated user
type Signer ¶
type Signer interface { // Sign a token and return the serialized cryptographic token. Sign(token *AuthToken) (string, error) }
Signer signs an issued token
type Verifier ¶
type Verifier interface { // Verify the payload and return the Token if the payload is valid. Verify(s string) (token *AuthToken, err error) }
Verifier verifies the serialized representation of a token
func NewVerifier ¶
NewVerifier reads a verification key file, and returns a verifier to verify token objects.
Click to show internal directories.
Click to hide internal directories.