Macros | Functions | Variables
json_token.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/security/credentials/jwt/json_token.h"
#include <stdint.h>
#include <string.h>
#include <map>
#include <string>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/slice/b64.h"
Include dependency graph for json_token.cc:

Go to the source code of this file.

Macros

#define GRPC_JWT_RSA_SHA256_ALGORITHM   "RS256"
 
#define GRPC_JWT_TYPE   "JWT"
 

Functions

char * compute_and_encode_signature (const grpc_auth_json_key *json_key, const char *signature_algorithm, const char *to_sign)
 
static char * dot_concat_and_free_strings (char *str1, char *str2)
 
static char * encoded_jwt_claim (const grpc_auth_json_key *json_key, const char *audience, gpr_timespec token_lifetime, const char *scope)
 
static char * encoded_jwt_header (const char *key_id, const char *algorithm)
 
grpc_auth_json_key grpc_auth_json_key_create_from_json (const Json &json)
 
grpc_auth_json_key grpc_auth_json_key_create_from_string (const char *json_string)
 
void grpc_auth_json_key_destruct (grpc_auth_json_key *json_key)
 
int grpc_auth_json_key_is_valid (const grpc_auth_json_key *json_key)
 
char * grpc_jwt_encode_and_sign (const grpc_auth_json_key *json_key, const char *audience, gpr_timespec token_lifetime, const char *scope)
 
void grpc_jwt_encode_and_sign_set_override (grpc_jwt_encode_and_sign_override func)
 
gpr_timespec grpc_max_auth_token_lifetime ()
 
const EVP_MDopenssl_digest_from_algorithm (const char *algorithm)
 

Variables

static grpc_jwt_encode_and_sign_override g_jwt_encode_and_sign_override
 

Macro Definition Documentation

◆ GRPC_JWT_RSA_SHA256_ALGORITHM

#define GRPC_JWT_RSA_SHA256_ALGORITHM   "RS256"

Definition at line 56 of file json_token.cc.

◆ GRPC_JWT_TYPE

#define GRPC_JWT_TYPE   "JWT"

Definition at line 57 of file json_token.cc.

Function Documentation

◆ compute_and_encode_signature()

char* compute_and_encode_signature ( const grpc_auth_json_key json_key,
const char *  signature_algorithm,
const char *  to_sign 
)

Definition at line 224 of file json_token.cc.

◆ dot_concat_and_free_strings()

static char* dot_concat_and_free_strings ( char *  str1,
char *  str2 
)
static

Definition at line 195 of file json_token.cc.

◆ encoded_jwt_claim()

static char* encoded_jwt_claim ( const grpc_auth_json_key json_key,
const char *  audience,
gpr_timespec  token_lifetime,
const char *  scope 
)
static

Definition at line 167 of file json_token.cc.

◆ encoded_jwt_header()

static char* encoded_jwt_header ( const char *  key_id,
const char *  algorithm 
)
static

Definition at line 157 of file json_token.cc.

◆ grpc_auth_json_key_create_from_json()

grpc_auth_json_key grpc_auth_json_key_create_from_json ( const Json json)

Definition at line 71 of file json_token.cc.

◆ grpc_auth_json_key_create_from_string()

grpc_auth_json_key grpc_auth_json_key_create_from_string ( const char *  json_string)

Definition at line 126 of file json_token.cc.

◆ grpc_auth_json_key_destruct()

void grpc_auth_json_key_destruct ( grpc_auth_json_key json_key)

Definition at line 134 of file json_token.cc.

◆ grpc_auth_json_key_is_valid()

int grpc_auth_json_key_is_valid ( const grpc_auth_json_key json_key)

Definition at line 66 of file json_token.cc.

◆ grpc_jwt_encode_and_sign()

char* grpc_jwt_encode_and_sign ( const grpc_auth_json_key json_key,
const char *  audience,
gpr_timespec  token_lifetime,
const char *  scope 
)

Definition at line 266 of file json_token.cc.

◆ grpc_jwt_encode_and_sign_set_override()

void grpc_jwt_encode_and_sign_set_override ( grpc_jwt_encode_and_sign_override  func)

Definition at line 286 of file json_token.cc.

◆ grpc_max_auth_token_lifetime()

gpr_timespec grpc_max_auth_token_lifetime ( )

Definition at line 48 of file json_token.cc.

◆ openssl_digest_from_algorithm()

const EVP_MD* openssl_digest_from_algorithm ( const char *  algorithm)

Definition at line 215 of file json_token.cc.

Variable Documentation

◆ g_jwt_encode_and_sign_override

grpc_jwt_encode_and_sign_override g_jwt_encode_and_sign_override
static
Initial value:
=
nullptr

Definition at line 61 of file json_token.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:21