⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsa_get_ex_new_index.pod

📁 开源的ssl算法openssl,版本0.9.8H
💻 POD
字号:
=pod=head1 NAMERSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application specific data to RSA structures=head1 SYNOPSIS #include <openssl/rsa.h> int RSA_get_ex_new_index(long argl, void *argp,		CRYPTO_EX_new *new_func,		CRYPTO_EX_dup *dup_func,		CRYPTO_EX_free *free_func); int RSA_set_ex_data(RSA *r, int idx, void *arg); void *RSA_get_ex_data(RSA *r, int idx); typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,                           int idx, long argl, void *argp); typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,                             int idx, long argl, void *argp); typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,                           int idx, long argl, void *argp);=head1 DESCRIPTIONSeveral OpenSSL structures can have application specific data attached to them.This has several potential uses, it can be used to cache data associated witha structure (for example the hash of some part of the structure) or someadditional data (for example a handle to the data in an external library).Since the application data can be anything at all it is passed and retrievedas a B<void *> type.The B<RSA_get_ex_new_index()> function is initially called to "register" somenew application specific data. It takes three optional function pointers whichare called when the parent structure (in this case an RSA structure) isinitially created, when it is copied and when it is freed up. If any or all ofthese function pointer arguments are not used they should be set to NULL. Theprecise manner in which these function pointers are called is described in moredetail below. B<RSA_get_ex_new_index()> also takes additional long and pointerparameters which will be passed to the supplied functions but which otherwisehave no special meaning. It returns an B<index> which should be stored(typically in a static variable) and passed used in the B<idx> parameter inthe remaining functions. Each successful call to B<RSA_get_ex_new_index()>will return an index greater than any previously returned, this is importantbecause the optional functions are called in order of increasing index value.B<RSA_set_ex_data()> is used to set application specific data, the data issupplied in the B<arg> parameter and its precise meaning is up to theapplication.B<RSA_get_ex_data()> is used to retrieve application specific data. The datais returned to the application, this will be the same value as supplied toa previous B<RSA_set_ex_data()> call.B<new_func()> is called when a structure is initially allocated (for examplewith B<RSA_new()>. The parent structure members will not have any meaningfulvalues at this point. This function will typically be used to allocate anyapplication specific structure.B<free_func()> is called when a structure is being freed up. The dynamic parentstructure members should not be accessed because they will be freed up whenthis function is called.B<new_func()> and B<free_func()> take the same parameters. B<parent> is apointer to the parent RSA structure. B<ptr> is a the application specific data(this wont be of much use in B<new_func()>. B<ad> is a pointer to theB<CRYPTO_EX_DATA> structure from the parent RSA structure: the functionsB<CRYPTO_get_ex_data()> and B<CRYPTO_set_ex_data()> can be called to manipulateit. The B<idx> parameter is the index: this will be the same value returned byB<RSA_get_ex_new_index()> when the functions were initially registered. Finallythe B<argl> and B<argp> parameters are the values originally passed to the samecorresponding parameters when B<RSA_get_ex_new_index()> was called.B<dup_func()> is called when a structure is being copied. Pointers to thedestination and source B<CRYPTO_EX_DATA> structures are passed in the B<to> andB<from> parameters respectively. The B<from_d> parameter is passed a pointer tothe source application data when the function is called, when the function returnsthe value is copied to the destination: the application can thus modify the datapointed to by B<from_d> and have different values in the source and destination.The B<idx>, B<argl> and B<argp> parameters are the same as those in B<new_func()>and B<free_func()>.=head1 RETURN VALUESB<RSA_get_ex_new_index()> returns a new index or -1 on failure (note 0 is a validindex value).B<RSA_set_ex_data()> returns 1 on success or 0 on failure.B<RSA_get_ex_data()> returns the application data or 0 on failure. 0 may alsobe valid application data but currently it can only fail if given an invalid B<idx>parameter.B<new_func()> and B<dup_func()> should return 0 for failure and 1 for success.On failure an error code can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>.=head1 BUGSB<dup_func()> is currently never called.The return value of B<new_func()> is ignored.The B<new_func()> function isn't very useful because no meaningful values arepresent in the parent RSA structure when it is called.=head1 SEE ALSOL<rsa(3)|rsa(3)>, L<CRYPTO_set_ex_data(3)|CRYPTO_set_ex_data(3)>=head1 HISTORYRSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() areavailable since SSLeay 0.9.0.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -