GRPC Core  44.2.0
credentials.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2024 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CREDENTIALS_H
20 #define GRPC_CREDENTIALS_H
21 
22 #include <grpc/grpc.h>
25 #include <stdbool.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
39 
47  gpr_timespec token_lifetime,
48  void* reserved);
49 
56  const char* json_string, const char* scopes_string);
57 
65  const char* json_refresh_token, void* reserved);
66 
70  const char* access_token, void* reserved);
71 
74  const char* authorization_token, const char* authority_selector,
75  void* reserved);
76 
83 typedef struct {
84  const char* token_exchange_service_uri; /* Required. */
85  const char* resource; /* Optional. */
86  const char* audience; /* Optional. */
87  const char* scope; /* Optional. */
88  const char* requested_token_type; /* Optional. */
89  const char* subject_token_path; /* Required. */
90  const char* subject_token_type; /* Required. */
91  const char* actor_token_path; /* Optional. */
92  const char* actor_token_type; /* Optional. */
94 
100  const grpc_sts_credentials_options* options, void* reserved);
101 
104 typedef struct {
106  const char* service_url;
107 
111  const char* method_name;
112 
115 
117  void* reserved;
119 
123 
126  grpc_auth_metadata_context* context);
127 
140  void* user_data, const grpc_metadata* creds_md, size_t num_creds_md,
141  grpc_status_code status, const char* error_details);
142 
145 #define GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX 4
146 
152 typedef struct {
171  int (*get_metadata)(
172  void* state, grpc_auth_metadata_context context,
173  grpc_credentials_plugin_metadata_cb cb, void* user_data,
175  size_t* num_creds_md, grpc_status_code* status,
176  const char** error_details);
177 
180  char* (*debug_string)(void* state);
181 
183  void (*destroy)(void* state);
184 
186  void* state;
187 
189  const char* type;
191 
196  grpc_security_level min_security_level, void* reserved);
197 
203 
223  grpc_call_credentials* call_credentials);
224 
231 
233 typedef struct {
236  const char* private_key;
237 
240  const char* cert_chain;
242 
255  const char* pem_root_certs,
256  const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
257  size_t num_key_cert_pairs);
258 
262 
271  void* user_data, grpc_ssl_server_certificate_config** config);
272 
277 typedef struct {
284  int (*verify_peer_callback)(const char* target_name, const char* peer_pem,
285  void* userdata);
292  void (*verify_peer_destruct)(void* userdata);
294 
297 typedef struct {
304  int (*verify_peer_callback)(const char* target_name, const char* peer_pem,
305  void* userdata);
312  void (*verify_peer_destruct)(void* userdata);
314 
346  const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
347  const verify_peer_options* verify_options, void* reserved);
348 
349 /* Creates an SSL credentials object.
350  The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.
351  - pem_root_certs is the NULL-terminated string containing the PEM encoding
352  of the server root certificates. If this parameter is NULL, the
353  implementation will first try to dereference the file pointed by the
354  GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,
355  try to get the roots set by grpc_override_ssl_default_roots. Eventually,
356  if all these fail, it will try to get the roots from a well-known place on
357  disk (in the grpc install directory).
358 
359  gRPC has implemented root cache if the underlying OpenSSL library supports
360  it. The gRPC root certificates cache is only applicable on the default
361  root certificates, which is used when this parameter is nullptr. If user
362  provides their own pem_root_certs, when creating an SSL credential object,
363  gRPC would not be able to cache it, and each subchannel will generate a
364  copy of the root store. So it is recommended to avoid providing large room
365  pem with pem_root_certs parameter to avoid excessive memory consumption,
366  particularly on mobile platforms such as iOS.
367  - pem_key_cert_pair is a pointer on the object containing client's private
368  key and certificate chain. This parameter can be NULL if the client does
369  not have such a key/cert pair.
370  - verify_options is an optional verify_peer_options object which holds
371  additional options controlling how peer certificates are verified. For
372  example, you can supply a callback which receives the peer's certificate
373  with which you can do additional verification. Can be NULL, in which
374  case verification will retain default behavior. Any settings in
375  verify_options are copied during this call, so the verify_options
376  object can be released afterwards. */
378  const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
379  const grpc_ssl_verify_peer_options* verify_options, void* reserved);
380 
396  const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
397  size_t num_key_cert_pairs, int force_client_auth, void* reserved);
398 
404  const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
405  size_t num_key_cert_pairs,
406  grpc_ssl_client_certificate_request_type client_certificate_request,
407  void* reserved);
408 
411 
418  grpc_ssl_client_certificate_request_type client_certificate_request,
419  grpc_ssl_server_certificate_config* certificate_config);
420 
430  grpc_ssl_client_certificate_request_type client_certificate_request,
431  grpc_ssl_server_certificate_config_callback cb, void* user_data);
432 
436 
442 
455  void* user_data, const grpc_metadata* consumed_md, size_t num_consumed_md,
456  const grpc_metadata* response_md, size_t num_response_md,
457  grpc_status_code status, const char* error_details);
458 
460 typedef struct {
465  void (*process)(void* state, grpc_auth_context* context,
466  const grpc_metadata* md, size_t num_md,
467  grpc_process_auth_metadata_done_cb cb, void* user_data);
468  void (*destroy)(void* state);
469  void* state;
471 
474 
480  void* reserved);
481 
486  void* reserved);
487 
491  grpc_channel_credentials* channel_creds, grpc_call_credentials* call_creds,
492  void* reserved);
493 
505 
512 
519 
529  grpc_alts_credentials_options* options, const char* service_account);
530 
541 
552  const grpc_alts_credentials_options* options);
553 
563  const grpc_alts_credentials_options* options);
564 
572 
583 
591 
599 
608  const char* private_key,
609  const char* cert_chain);
610 
620 
634  const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
635 
659  const char* private_key_path, const char* identity_certificate_path,
660  const char* root_cert_path, unsigned int refresh_interval_sec);
661 
670 
680  /* The target name of the server when the client initiates the connection. */
681  /* This field will be nullptr if on the server side. */
682  const char* target_name;
683  /* The information contained in the certificate chain sent from the peer. */
684  struct peer_info {
685  /* The Common Name field on the peer leaf certificate. */
686  const char* common_name;
687  /* The list of Subject Alternative Names on the peer leaf certificate. */
688  struct san_names {
689  char** uri_names;
691  char** dns_names;
693  char** email_names;
695  char** ip_names;
697  } san_names;
698  /* The raw peer leaf certificate. */
699  const char* peer_cert;
700  /* The raw peer certificate chain. Note that it is not always guaranteed to
701  * get the peer full chain. For more, please refer to
702  * GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME defined in file
703  * grpc_security_constants.h.
704  * TODO(ZhenLian): Consider fixing this in the future. */
705  const char* peer_cert_full_chain;
706  /* The verified root cert subject.
707  * This value will only be filled if the cryptographic peer certificate
708  * verification was successful */
710  } peer_info;
712 
723  grpc_tls_custom_verification_check_request* request, void* callback_arg,
724  grpc_status_code status, const char* error_details);
725 
732 
740  void* user_data;
774  int (*verify)(void* user_data,
777  void* callback_arg, grpc_status_code* sync_status,
778  char** sync_error_details);
794  void (*cancel)(void* user_data,
813  void (*destruct)(void* user_data);
815 
824  grpc_tls_certificate_verifier_external* external_verifier);
825 
836 
844 
853 
867  grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
868  grpc_status_code* sync_status, char** sync_error_details);
869 
880 
887 
898 
908 
916  grpc_tls_credentials_options* options, grpc_tls_version min_tls_version);
917 
925  grpc_tls_credentials_options* options, grpc_tls_version max_tls_version);
926 
934 
942 
950 
960 
975 
983  grpc_tls_credentials_options* options, const char* root_cert_name);
984 
994 
1003  grpc_tls_credentials_options* options, const char* identity_cert_name);
1004 
1014 
1026  grpc_tls_credentials_options* options, const char* crl_directory);
1027 
1035  grpc_tls_credentials_options* options, int verify_server_cert);
1036 
1052  grpc_tls_credentials_options* options, bool send_client_ca_list);
1053 
1060 
1064  size_t capacity);
1065 
1068 
1072 
1080  char** pem_root_certs);
1081 
1089 
1091 
1100 
1107 
1122  grpc_channel_credentials* fallback_credentials);
1123 
1136  grpc_server_credentials* fallback_credentials);
1137 
1152 
1163 
1170 
1181  grpc_tls_certificate_verifier* verifier);
1182 
1195  grpc_tls_credentials_options* options, int check_call_host);
1196 
1215  grpc_tls_credentials_options* options, const char* path);
1216 
1217 #ifdef __cplusplus
1218 }
1219 #endif
1220 
1221 #endif /* GRPC_CREDENTIALS_H */
grpc_arg
A single argument...
Definition: grpc_types.h:101
grpc_tls_custom_verification_check_request::peer_info::peer_cert
const char * peer_cert
Definition: credentials.h:699
grpc_ssl_server_credentials_create_ex
GRPCAPI grpc_server_credentials * grpc_ssl_server_credentials_create_ex(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, size_t num_key_cert_pairs, grpc_ssl_client_certificate_request_type client_certificate_request, void *reserved)
Deprecated in favor of grpc_ssl_server_credentials_create_with_options.
grpc_ssl_credentials_create_ex
GRPCAPI grpc_channel_credentials * grpc_ssl_credentials_create_ex(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, const grpc_ssl_verify_peer_options *verify_options, void *reserved)
grpc_ssl_server_credentials_create_options_using_config_fetcher
GRPCAPI grpc_ssl_server_credentials_options * grpc_ssl_server_credentials_create_options_using_config_fetcher(grpc_ssl_client_certificate_request_type client_certificate_request, grpc_ssl_server_certificate_config_callback cb, void *user_data)
Creates an options object using a certificate config fetcher.
grpc_tls_credentials_options_set_tls_session_key_log_file_path
GRPCAPI void grpc_tls_credentials_options_set_tls_session_key_log_file_path(grpc_tls_credentials_options *options, const char *path)
— TLS session key logging.
grpc_ssl_session_cache_destroy
GRPCAPI void grpc_ssl_session_cache_destroy(grpc_ssl_session_cache *cache)
Destroy SSL session cache.
grpc_tls_custom_verification_check_request::peer_info::peer_cert_full_chain
const char * peer_cert_full_chain
Definition: credentials.h:705
verify_peer_options::verify_peer_callback_userdata
void * verify_peer_callback_userdata
Arbitrary userdata that will be passed as the last argument to verify_peer_callback.
Definition: credentials.h:288
grpc_sts_credentials_create
GRPCAPI grpc_call_credentials * grpc_sts_credentials_create(const grpc_sts_credentials_options *options, void *reserved)
Creates an STS credentials following the STS Token Exchanged specified in the IETF draft https://tool...
grpc_tls_on_custom_verification_check_done_cb
void(* grpc_tls_on_custom_verification_check_done_cb)(grpc_tls_custom_verification_check_request *request, void *callback_arg, grpc_status_code status, const char *error_details)
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:722
grpc_tls_certificate_verifier_external_create
grpc_tls_certificate_verifier * grpc_tls_certificate_verifier_external_create(grpc_tls_certificate_verifier_external *external_verifier)
EXPERIMENTAL API - Subject to change.
grpc_ssl_verify_peer_options
Object that holds additional peer-verification options on a secure channel.
Definition: credentials.h:297
grpc_sts_credentials_options::subject_token_path
const char * subject_token_path
Definition: credentials.h:89
grpc_ssl_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_ssl_server_credentials_create(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, size_t num_key_cert_pairs, int force_client_auth, void *reserved)
— server credentials —
grpc_tls_certificate_verifier_external::cancel
void(* cancel)(void *user_data, grpc_tls_custom_verification_check_request *request)
A function pointer that cleans up the caller-specified resources when the verifier is still running b...
Definition: credentials.h:794
grpc_ssl_pem_key_cert_pair::private_key
const char * private_key
private_key is the NULL-terminated string containing the PEM encoding of the client's private key.
Definition: credentials.h:236
grpc_tls_credentials_options
struct grpc_tls_credentials_options grpc_tls_credentials_options
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:571
grpc_alts_credentials_client_options_create
GRPCAPI grpc_alts_credentials_options * grpc_alts_credentials_client_options_create(void)
This method creates a grpc ALTS credentials client options instance.
grpc_ssl_verify_peer_options::verify_peer_callback_userdata
void * verify_peer_callback_userdata
Arbitrary userdata that will be passed as the last argument to verify_peer_callback.
Definition: credentials.h:308
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:730
grpc_sts_credentials_options::resource
const char * resource
Definition: credentials.h:85
grpc_ssl_server_credentials_create_with_options
GRPCAPI grpc_server_credentials * grpc_ssl_server_credentials_create_with_options(grpc_ssl_server_credentials_options *options)
Creates an SSL server_credentials object using the provided options struct.
grpc_tls_custom_verification_check_request::peer_info::san_names::email_names
char ** email_names
Definition: credentials.h:693
grpc_ssl_server_certificate_config
struct grpc_ssl_server_certificate_config grpc_ssl_server_certificate_config
Server certificate config object holds the server's public certificates and associated private keys,...
Definition: credentials.h:229
grpc_sts_credentials_options
Options for creating STS Oauth Token Exchange credentials following the IETF draft https://tools....
Definition: credentials.h:83
grpc_metadata_credentials_plugin::state
void * state
State that will be set as the first parameter of the methods above.
Definition: credentials.h:186
grpc_tls_credentials_options_set_min_tls_version
GRPCAPI void grpc_tls_credentials_options_set_min_tls_version(grpc_tls_credentials_options *options, grpc_tls_version min_tls_version)
EXPERIMENTAL API - Subject to change.
grpc_ssl_certificate_config_reload_status
grpc_ssl_certificate_config_reload_status
Callback results for dynamically loading a SSL certificate config.
Definition: grpc_security_constants.h:73
grpc_sts_credentials_options::audience
const char * audience
Definition: credentials.h:86
grpc_tls_certificate_provider_release
GRPCAPI void grpc_tls_certificate_provider_release(grpc_tls_certificate_provider *provider)
EXPERIMENTAL API - Subject to change.
grpc_tls_credentials_options_copy
GRPCAPI grpc_tls_credentials_options * grpc_tls_credentials_options_copy(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_auth_metadata_context::service_url
const char * service_url
The fully qualified service url.
Definition: credentials.h:106
grpc_alts_credentials_server_options_create
GRPCAPI grpc_alts_credentials_options * grpc_alts_credentials_server_options_create(void)
This method creates a grpc ALTS credentials server options instance.
grpc_ssl_server_certificate_config_create
GRPCAPI grpc_ssl_server_certificate_config * grpc_ssl_server_certificate_config_create(const char *pem_root_certs, const grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, size_t num_key_cert_pairs)
Creates a grpc_ssl_server_certificate_config object.
grpc_tls_custom_verification_check_request::peer_info::common_name
const char * common_name
Definition: credentials.h:686
grpc_tls_credentials_options_set_check_call_host
GRPCAPI void grpc_tls_credentials_options_set_check_call_host(grpc_tls_credentials_options *options, int check_call_host)
EXPERIMENTAL API - Subject to change.
grpc_alts_credentials_client_options_add_target_service_account
GRPCAPI void grpc_alts_credentials_client_options_add_target_service_account(grpc_alts_credentials_options *options, const char *service_account)
This method adds a target service account to grpc client's ALTS credentials options instance.
grpc_alts_credentials_options_destroy
GRPCAPI void grpc_alts_credentials_options_destroy(grpc_alts_credentials_options *options)
This method destroys a grpc_alts_credentials_options instance by de-allocating all of its occupied me...
grpc_tls_identity_pairs_create
GRPCAPI grpc_tls_identity_pairs * grpc_tls_identity_pairs_create()
EXPERIMENTAL API - Subject to change.
grpc_ssl_server_credentials_create_options_using_config
GRPCAPI grpc_ssl_server_credentials_options * grpc_ssl_server_credentials_create_options_using_config(grpc_ssl_client_certificate_request_type client_certificate_request, grpc_ssl_server_certificate_config *certificate_config)
Creates an options object using a certificate config.
grpc_auth_metadata_context_reset
GRPCAPI void grpc_auth_metadata_context_reset(grpc_auth_metadata_context *context)
Releases internal resources held by context.
grpc_google_default_credentials_create
GRPCAPI grpc_channel_credentials * grpc_google_default_credentials_create(grpc_call_credentials *call_credentials)
Creates default credentials to connect to a google gRPC service.
grpc_tls_credentials_create
grpc_channel_credentials * grpc_tls_credentials_create(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_tls_identity_pairs
struct grpc_tls_identity_pairs grpc_tls_identity_pairs
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:590
grpc_tls_custom_verification_check_request::peer_info::san_names::dns_names
char ** dns_names
Definition: credentials.h:691
grpc_metadata_credentials_create_from_plugin
GRPCAPI grpc_call_credentials * grpc_metadata_credentials_create_from_plugin(grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void *reserved)
Creates a credentials object from a plugin with a specified minimum security level.
grpc_ssl_pem_key_cert_pair::cert_chain
const char * cert_chain
cert_chain is the NULL-terminated string containing the PEM encoding of the client's certificate chai...
Definition: credentials.h:240
grpc_tls_custom_verification_check_request::peer_info::san_names
struct grpc_tls_custom_verification_check_request::peer_info::san_names san_names
grpc_auth_metadata_context::reserved
void * reserved
Reserved for future use.
Definition: credentials.h:117
grpc_tls_credentials_options_set_cert_request_type
GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(grpc_tls_credentials_options *options, grpc_ssl_client_certificate_request_type type)
EXPERIMENTAL API - Subject to change.
grpc_tls_custom_verification_check_request::peer_info
Definition: credentials.h:684
grpc_ssl_server_certificate_config_destroy
GRPCAPI void grpc_ssl_server_certificate_config_destroy(grpc_ssl_server_certificate_config *config)
Destroys a grpc_ssl_server_certificate_config object.
grpc_xds_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_xds_server_credentials_create(grpc_server_credentials *fallback_credentials)
EXPERIMENTAL API - Subject to change.
grpc_google_refresh_token_credentials_create
GRPCAPI grpc_call_credentials * grpc_google_refresh_token_credentials_create(const char *json_refresh_token, void *reserved)
Creates an Oauth2 Refresh Token credentials object for connecting to Google.
grpc_tls_certificate_verifier_verify
int grpc_tls_certificate_verifier_verify(grpc_tls_certificate_verifier *verifier, grpc_tls_custom_verification_check_request *request, grpc_tls_on_custom_verification_check_done_cb callback, void *callback_arg, grpc_status_code *sync_status, char **sync_error_details)
EXPERIMENTAL API - Subject to change.
grpc_ssl_server_credentials_options_destroy
GRPCAPI void grpc_ssl_server_credentials_options_destroy(grpc_ssl_server_credentials_options *options)
Destroys a grpc_ssl_server_credentials_options object.
grpc_xds_credentials_create
GRPCAPI grpc_channel_credentials * grpc_xds_credentials_create(grpc_channel_credentials *fallback_credentials)
EXPERIMENTAL API - Subject to change.
grpc_metadata
A single metadata element.
Definition: grpc_types.h:209
grpc_tls_custom_verification_check_request::peer_info::san_names::uri_names
char ** uri_names
Definition: credentials.h:689
grpc_auth_metadata_context::method_name
const char * method_name
The method name of the RPC being called (not fully qualified).
Definition: credentials.h:111
grpc_tls_certificate_verifier_external
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:739
GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX
#define GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX
Maximum number of metadata entries returnable by a credentials plugin via a synchronous return.
Definition: credentials.h:145
grpc_tls_custom_verification_check_request::peer_info::san_names::ip_names_size
size_t ip_names_size
Definition: credentials.h:696
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
— insecure credentials —
grpc_tls_custom_verification_check_request::target_name
const char * target_name
Definition: credentials.h:682
grpc_composite_call_credentials_create
GRPCAPI grpc_call_credentials * grpc_composite_call_credentials_create(grpc_call_credentials *creds1, grpc_call_credentials *creds2, void *reserved)
— composite credentials —
grpc_channel_credentials
struct grpc_channel_credentials grpc_channel_credentials
— grpc_channel_credentials object.
Definition: grpc.h:286
grpc_sts_credentials_options::actor_token_path
const char * actor_token_path
Definition: credentials.h:91
grpc_tls_certificate_provider_file_watcher_create
GRPCAPI grpc_tls_certificate_provider * grpc_tls_certificate_provider_file_watcher_create(const char *private_key_path, const char *identity_certificate_path, const char *root_cert_path, unsigned int refresh_interval_sec)
EXPERIMENTAL API - Subject to change.
grpc_auth_context
struct grpc_auth_context grpc_auth_context
Definition: credentials.h:38
grpc_sts_credentials_options::scope
const char * scope
Definition: credentials.h:87
grpc_tls_credentials_options_set_root_cert_name
GRPCAPI void grpc_tls_credentials_options_set_root_cert_name(grpc_tls_credentials_options *options, const char *root_cert_name)
EXPERIMENTAL API - Subject to change.
grpc_tls_certificate_verifier_external
struct grpc_tls_certificate_verifier_external grpc_tls_certificate_verifier_external
EXPERIMENTAL API - Subject to change.
grpc_status_code
grpc_status_code
Definition: status.h:28
grpc_tls_certificate_verifier_external::destruct
void(* destruct)(void *user_data)
A function pointer that does some additional destruction work when the verifier is destroyed.
Definition: credentials.h:813
grpc.h
grpc_ssl_roots_override_result
grpc_ssl_roots_override_result
Results for the SSL roots override callback.
Definition: grpc_security_constants.h:66
grpc_tls_certificate_verifier_external::user_data
void * user_data
Definition: credentials.h:740
grpc_tls_credentials_options_create
GRPCAPI grpc_tls_credentials_options * grpc_tls_credentials_options_create(void)
EXPERIMENTAL API - Subject to change.
grpc_tls_certificate_verifier_external::verify
int(* verify)(void *user_data, grpc_tls_custom_verification_check_request *request, grpc_tls_on_custom_verification_check_done_cb callback, void *callback_arg, grpc_status_code *sync_status, char **sync_error_details)
A function pointer containing the verification logic that will be performed after the TLS handshake i...
Definition: credentials.h:774
grpc_tls_custom_verification_check_request::peer_info::san_names::uri_names_size
size_t uri_names_size
Definition: credentials.h:690
grpc_ssl_client_certificate_request_type
grpc_ssl_client_certificate_request_type
Definition: grpc_security_constants.h:79
grpc_set_ssl_roots_override_callback
GRPCAPI void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb)
Setup a callback to override the default TLS/SSL roots.
grpc_tls_version
grpc_tls_version
The TLS versions that are supported by the SSL stack.
Definition: grpc_security_constants.h:146
grpc_metadata_credentials_plugin
grpc_metadata_credentials plugin is an API user provided structure used to create grpc_credentials ob...
Definition: credentials.h:152
grpc_ssl_session_cache_create_channel_arg
GRPCAPI grpc_arg grpc_ssl_session_cache_create_channel_arg(grpc_ssl_session_cache *cache)
Create a channel arg with the given cache object.
grpc_tls_credentials_options_set_max_tls_version
GRPCAPI void grpc_tls_credentials_options_set_max_tls_version(grpc_tls_credentials_options *options, grpc_tls_version max_tls_version)
EXPERIMENTAL API - Subject to change.
grpc_alts_credentials_create
GRPCAPI grpc_channel_credentials * grpc_alts_credentials_create(const grpc_alts_credentials_options *options)
This method creates an ALTS channel credential object.
grpc_tls_credentials_options_set_certificate_verifier
void grpc_tls_credentials_options_set_certificate_verifier(grpc_tls_credentials_options *options, grpc_tls_certificate_verifier *verifier)
EXPERIMENTAL API - Subject to change.
grpc_sts_credentials_options::token_exchange_service_uri
const char * token_exchange_service_uri
Definition: credentials.h:84
grpc_composite_channel_credentials_create
GRPCAPI grpc_channel_credentials * grpc_composite_channel_credentials_create(grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds, void *reserved)
Creates a composite channel credentials object.
grpc_alts_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_alts_server_credentials_create(const grpc_alts_credentials_options *options)
This method creates an ALTS server credential object.
grpc_ssl_session_cache
struct grpc_ssl_session_cache grpc_ssl_session_cache
— SSL Session Cache.
Definition: credentials.h:1059
verify_peer_options
Deprecated in favor of grpc_ssl_verify_peer_options.
Definition: credentials.h:277
grpc_credentials_plugin_metadata_cb
void(* grpc_credentials_plugin_metadata_cb)(void *user_data, const grpc_metadata *creds_md, size_t num_creds_md, grpc_status_code status, const char *error_details)
Callback function to be called by the metadata credentials plugin implementation when the metadata is...
Definition: credentials.h:139
grpc_tls_certificate_provider_static_data_create
GRPCAPI grpc_tls_certificate_provider * grpc_tls_certificate_provider_static_data_create(const char *root_certificate, grpc_tls_identity_pairs *pem_key_cert_pairs)
EXPERIMENTAL API - Subject to change.
grpc_tls_custom_verification_check_request::peer_info::san_names::ip_names
char ** ip_names
Definition: credentials.h:695
grpc_tls_custom_verification_check_request::peer_info::san_names
Definition: credentials.h:688
grpc_insecure_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_insecure_server_credentials_create()
EXPERIMENTAL API - Subject to change.
grpc_tls_credentials_options_set_identity_cert_name
GRPCAPI void grpc_tls_credentials_options_set_identity_cert_name(grpc_tls_credentials_options *options, const char *identity_cert_name)
EXPERIMENTAL API - Subject to change.
grpc_tls_certificate_verifier_release
void grpc_tls_certificate_verifier_release(grpc_tls_certificate_verifier *verifier)
EXPERIMENTAL API - Subject to change.
grpc_access_token_credentials_create
GRPCAPI grpc_call_credentials * grpc_access_token_credentials_create(const char *access_token, void *reserved)
Creates an Oauth2 Access Token credentials with an access token that was acquired by an out of band m...
grpc_auth_metadata_context_copy
GRPCAPI void grpc_auth_metadata_context_copy(grpc_auth_metadata_context *from, grpc_auth_metadata_context *to)
Performs a deep copy from from to to.
grpc_security_level
grpc_security_level
Definition: grpc_security_constants.h:131
grpc_ssl_server_certificate_config_callback
grpc_ssl_certificate_config_reload_status(* grpc_ssl_server_certificate_config_callback)(void *user_data, grpc_ssl_server_certificate_config **config)
Callback to retrieve updated SSL server certificates, private keys, and trusted CAs (for client authe...
Definition: credentials.h:270
grpc_service_account_jwt_access_credentials_create
GRPCAPI grpc_call_credentials * grpc_service_account_jwt_access_credentials_create(const char *json_key, gpr_timespec token_lifetime, void *reserved)
Creates a JWT credentials object.
grpc_tls_credentials_options_set_crl_directory
GRPCAPI void grpc_tls_credentials_options_set_crl_directory(grpc_tls_credentials_options *options, const char *crl_directory)
Deprecated in favor of grpc_tls_credentials_options_set_crl_provider.
grpc_metadata_credentials_plugin::type
const char * type
Type of credentials that this plugin is implementing.
Definition: credentials.h:189
grpc_ssl_credentials_create
GRPCAPI grpc_channel_credentials * grpc_ssl_credentials_create(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, const verify_peer_options *verify_options, void *reserved)
Deprecated in favor of grpc_ssl_server_credentials_create_ex.
grpc_local_credentials_create
GRPCAPI grpc_channel_credentials * grpc_local_credentials_create(grpc_local_connect_type type)
— Local channel/server credentials —
grpc_auth_metadata_context::channel_auth_context
const grpc_auth_context * channel_auth_context
The auth_context of the channel which gives the server's identity.
Definition: credentials.h:114
grpc_tls_credentials_options_set_certificate_provider
GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(grpc_tls_credentials_options *options, grpc_tls_certificate_provider *provider)
EXPERIMENTAL API - Subject to change.
grpc_sts_credentials_options::requested_token_type
const char * requested_token_type
Definition: credentials.h:88
grpc_ssl_session_cache_create_lru
GRPCAPI grpc_ssl_session_cache * grpc_ssl_session_cache_create_lru(size_t capacity)
Create LRU cache for client-side SSL sessions with the given capacity.
grpc_process_auth_metadata_done_cb
void(* grpc_process_auth_metadata_done_cb)(void *user_data, const grpc_metadata *consumed_md, size_t num_consumed_md, const grpc_metadata *response_md, size_t num_response_md, grpc_status_code status, const char *error_details)
— Auth Metadata Processing —
Definition: credentials.h:454
grpc_tls_custom_verification_check_request::peer_info::san_names::dns_names_size
size_t dns_names_size
Definition: credentials.h:692
grpc_ssl_roots_override_callback
grpc_ssl_roots_override_result(* grpc_ssl_roots_override_callback)(char **pem_root_certs)
Callback for getting the SSL roots override from the application.
Definition: credentials.h:1079
grpc_auth_metadata_processor
Pluggable server-side metadata processor object.
Definition: credentials.h:460
grpc_security_constants.h
grpc_tls_certificate_verifier_host_name_create
grpc_tls_certificate_verifier * grpc_tls_certificate_verifier_host_name_create()
EXPERIMENTAL API - Subject to change.
grpc_tls_server_credentials_create
grpc_server_credentials * grpc_tls_server_credentials_create(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_tls_credentials_options_watch_identity_key_cert_pairs
GRPCAPI void grpc_tls_credentials_options_watch_identity_key_cert_pairs(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_tls_credentials_options_set_verify_server_cert
GRPCAPI void grpc_tls_credentials_options_set_verify_server_cert(grpc_tls_credentials_options *options, int verify_server_cert)
EXPERIMENTAL API - Subject to change.
grpc_max_auth_token_lifetime
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void)
grpc_tls_custom_verification_check_request
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:679
grpc_call_credentials
struct grpc_call_credentials grpc_call_credentials
— grpc_call_credentials object —
Definition: credentials.h:37
grpc_external_account_credentials_create
GRPCAPI grpc_call_credentials * grpc_external_account_credentials_create(const char *json_string, const char *scopes_string)
Builds External Account credentials.
grpc_alts_credentials_options
struct grpc_alts_credentials_options grpc_alts_credentials_options
— ALTS channel/server credentials —
Definition: credentials.h:504
grpc_tls_identity_pairs_destroy
GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs *pairs)
EXPERIMENTAL API - Subject to change.
grpc_sts_credentials_options::actor_token_type
const char * actor_token_type
Definition: credentials.h:92
grpc_tls_credentials_options_set_send_client_ca_list
GRPCAPI void grpc_tls_credentials_options_set_send_client_ca_list(grpc_tls_credentials_options *options, bool send_client_ca_list)
EXPERIMENTAL API - Subject to change.
grpc_server_credentials_set_auth_metadata_processor
GRPCAPI void grpc_server_credentials_set_auth_metadata_processor(grpc_server_credentials *creds, grpc_auth_metadata_processor processor)
gpr_timespec
Analogous to struct timespec.
Definition: time.h:47
grpc_server_credentials
struct grpc_server_credentials grpc_server_credentials
— grpc_server_credentials object.
Definition: grpc.h:298
grpc_tls_certificate_verifier
struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier
EXPERIMENTAL API - Subject to change.
Definition: credentials.h:731
grpc_call_credentials_release
GRPCAPI void grpc_call_credentials_release(grpc_call_credentials *creds)
— channel credentials —
grpc_auth_metadata_context
Context that can be used by metadata credentials plugin in order to create auth related metadata.
Definition: credentials.h:104
grpc_tls_custom_verification_check_request
struct grpc_tls_custom_verification_check_request grpc_tls_custom_verification_check_request
EXPERIMENTAL API - Subject to change.
grpc_sts_credentials_options::subject_token_type
const char * subject_token_type
Definition: credentials.h:90
grpc_tls_credentials_options_watch_root_certs
GRPCAPI void grpc_tls_credentials_options_watch_root_certs(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_tls_custom_verification_check_request::peer_info
struct grpc_tls_custom_verification_check_request::peer_info peer_info
grpc_tls_custom_verification_check_request::peer_info::verified_root_cert_subject
const char * verified_root_cert_subject
Definition: credentials.h:709
grpc_tls_credentials_options_destroy
GRPCAPI void grpc_tls_credentials_options_destroy(grpc_tls_credentials_options *options)
EXPERIMENTAL API - Subject to change.
grpc_tls_certificate_provider
struct grpc_tls_certificate_provider grpc_tls_certificate_provider
— TLS channel/server credentials — It is used for experimental purpose for now and subject to change.
Definition: credentials.h:582
grpc_local_connect_type
grpc_local_connect_type
Type of local connections for which local channel/server credentials will be applied.
Definition: grpc_security_constants.h:143
grpc_google_iam_credentials_create
GRPCAPI grpc_call_credentials * grpc_google_iam_credentials_create(const char *authorization_token, const char *authority_selector, void *reserved)
Creates an IAM credentials object for connecting to Google.
grpc_ssl_pem_key_cert_pair
Object that holds a private key / certificate chain pair in PEM format.
Definition: credentials.h:233
grpc_tls_custom_verification_check_request::peer_info::san_names::email_names_size
size_t email_names_size
Definition: credentials.h:694
grpc_tls_certificate_verifier_cancel
void grpc_tls_certificate_verifier_cancel(grpc_tls_certificate_verifier *verifier, grpc_tls_custom_verification_check_request *request)
EXPERIMENTAL API - Subject to change.
grpc_ssl_server_credentials_options
struct grpc_ssl_server_credentials_options grpc_ssl_server_credentials_options
Definition: credentials.h:409
grpc_auth_metadata_processor::state
void * state
Definition: credentials.h:469
grpc_google_compute_engine_credentials_create
GRPCAPI grpc_call_credentials * grpc_google_compute_engine_credentials_create(void *reserved)
Creates a compute engine credentials object for connecting to Google.
grpc_tls_certificate_verifier_no_op_create
grpc_tls_certificate_verifier * grpc_tls_certificate_verifier_no_op_create()
EXPERIMENTAL API - Subject to change.
grpc_tls_identity_pairs_add_pair
GRPCAPI void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs *pairs, const char *private_key, const char *cert_chain)
EXPERIMENTAL API - Subject to change.
port_platform.h
grpc_local_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_local_server_credentials_create(grpc_local_connect_type type)
This method creates a local server credential object.