Package oauth2client :: Module crypt
[hide private]
[frames] | no frames]

Module crypt

source code

Classes [hide private]
  AppIdentityError
Functions [hide private]
 
_urlsafe_b64encode(raw_bytes) source code
 
_urlsafe_b64decode(b64string) source code
 
_json_encode(data) source code
 
make_signed_jwt(signer, payload)
Make a signed JWT.
source code
 
verify_signed_jwt_with_certs(jwt, certs, audience)
Verify a JWT against public certs.
source code
Variables [hide private]
  CLOCK_SKEW_SECS = 300
  AUTH_TOKEN_LIFETIME_SECS = 300
  MAX_TOKEN_LIFETIME_SECS = 86400
  logger = logging.getLogger(__name__)
  OpenSSLVerifier = None
  OpenSSLSigner = None
  PyCryptoVerifier = None
  PyCryptoSigner = None
  Signer = None
  Verifier = None
Function Details [hide private]

make_signed_jwt(signer, payload)

source code 
Make a signed JWT.

See http://self-issued.info/docs/draft-jones-json-web-token.html.

Args:
  signer: crypt.Signer, Cryptographic signer.
  payload: dict, Dictionary of data to convert to JSON and then sign.

Returns:
  string, The JWT for the payload.

verify_signed_jwt_with_certs(jwt, certs, audience)

source code 
Verify a JWT against public certs.

See http://self-issued.info/docs/draft-jones-json-web-token.html.

Args:
  jwt: string, A JWT.
  certs: dict, Dictionary where values of public keys in PEM format.
  audience: string, The audience, 'aud', that this JWT should contain. If
    None then the JWT's 'aud' parameter is not verified.

Returns:
  dict, The deserialized JSON payload in the JWT.

Raises:
  AppIdentityError if any checks are failed.