📄 ismacryplib.h
字号:
ismacryp_rc_t ismacrypSetScheme(ismacryp_session_id_t session, ismacryp_scheme_t scheme);ismacryp_rc_t ismacrypGetScheme(ismacryp_session_id_t session, ismacryp_scheme_t *scheme);/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp scheme version (see specification) for a given session.The get function updates the scheme parameter with the only currently-defined encryption scheme version of 1. The set function allows for setting of any defined Ismacryp scheme versions. The session parameter in both functions is the value initially obtained with ismaCrypInitSession. A return code of ismacryp_rc_ok indicates successful completion of these functions.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that scheme version was not properly returned or not properly set.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetSchemeVersion(ismacryp_session_id_t session, ismacryp_schemeversion_t scheme);ismacryp_rc_t ismacrypGetSchemeVersion(ismacryp_session_id_t session, ismacryp_schemeversion_t *scheme);/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp KMS URI (see specification) for a given session.The get function updates the kms_uri parameter with the uri of the Key Management System. The set function allows for setting of this same parameter. The session parameter in both functions is the value initially obtained with ismaCrypInitSession. A return code of ismacryp_rc_ok indicates successful completion of these functions.On success of the get function, kms_uri points at newly allocated memory which the calling function is responsible for freeing when it is no longer needed.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that KMS URI was not properly returned or not properly set.NOTE: KMS URI is not supported in this implementation.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetKMSUri(ismacryp_session_id_t session, char *kms_uri );ismacryp_rc_t ismacrypGetKMSUri(ismacryp_session_id_t session, const char **kms_uri );/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp selective encryptionvalue (see specification) for a given session.The get function updates the selective_is_on parameter with either TRUE or FALSE (1 or 0) indicating whether or not selective encryption is enabled for the session. The set function allows for setting this same value. The session parameter in both functions is the value initially obtained with ismaCrypInitSession.A return code of ismacryp_rc_ok indicates successful completion of these functions.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that the selective encryption value was not properly returned or not properly set.NOTE: Selective Encryption is not supported in this implementation.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetSelectiveEncryption(ismacryp_session_id_t session, uint8_t selective_is_on );ismacryp_rc_t ismacrypGetSelectiveEncryption(ismacryp_session_id_t session, uint8_t *selective_is_on );/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp key indicator lengthvalue (see specification) for a given session.The get function updates the key_indicator_len parameter with the key indicator length as defined in the Ismacryp spec. The set function allows for setting this same value. The session parameter in both functions is the value initially obtained with ismaCrypInitSession.A return code of ismacryp_rc_ok indicates successful completion of these functions.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that the key indicator length was not properly returned or not properly set.NOTE: Key indicator length pertains to the changing of keys during a session.This is not supported in this implementation.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetKeyIndicatorLength(ismacryp_session_id_t session, uint8_t key_indicator_len);ismacryp_rc_t ismacrypGetKeyIndicatorLength(ismacryp_session_id_t session, uint8_t *key_indicator_len);/*--------------------------------------------------------------------------------This functions is used to get the Ismacryp key indicator per au value (see specification) for a given session. Value returned is either TRUE orFALSE (1 or 0).A return code of ismacryp_rc_ok indicates successful completion of this function.Any return code other than ismacryp_rc_ok means that this function was called with invalid session identifier or a system error has occurred. In this case the application must assume that the key indicator per au value was not properly returned.NOTE: Key indicator per au pertains to selective encryption which is notsupported in this implementation. Thus the value returned by this function isalways FALSE (0).--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypGetKeyIndPerAU(ismacryp_session_id_t session, uint8_t *key_ind_per_au);/*--------------------------------------------------------------------------------This functions is used to get the Ismacryp key count value (see specification) for a given session. A return code of ismacryp_rc_ok indicates successful completion of this function.Any return code other than ismacryp_rc_ok means that this function was called with invalid session identifier or a system error has occurred. In this case the application must assume that the key count value was not properly returned.NOTE: Key count pertains to the changing of keys during a session.This is not supported in this implementation. Thus the value returned by thisfunction is always 1 (i.e. 1 key per session).--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypGetKeyCount(ismacryp_session_id_t session, uint8_t *keycount);/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp initialization vector lengthvalue (see specification) for a given session.The get function updates the iv_len parameter with the length of the initialization vector as defined in the Ismacryp spec. The set function allows for setting this same value. The session parameter in both functions is the value initially obtained with ismaCrypInitSession. A return code of ismacryp_rc_ok indicates successful completion of these functions.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that the initialization vector length was not properly returned or not properly set.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetIVLength(ismacryp_session_id_t session, uint8_t iv_len);ismacryp_rc_t ismacrypGetIVLength(ismacryp_session_id_t session, uint8_t *iv_len);/*--------------------------------------------------------------------------------These functions are used to set and get the Ismacryp initialization vector deltalength value (see specification) for a given session.The get function updates the delta_iv_len parameter with the length of the initialization vector that is conveyed with an individual AU as defined in the Ismacryp spec. The set function allows for setting this same value. The session parameter in both functions is the value initially obtained with ismaCrypInitSession.A return code of ismacryp_rc_ok indicates successful completion of these functions.Any return code other than ismacryp_rc_ok means that these functions were called with invalid session identifiers or a system error has occurred. In this case the application must assume that the initialization vector delta length was not properly returned or not properly set.--------------------------------------------------------------------------------*/ismacryp_rc_t ismacrypSetDeltaIVLength(ismacryp_session_id_t session, uint8_t delta_iv_len);ismacryp_rc_t ismacrypGetDeltaIVLength(ismacryp_session_id_t session, uint8_t *delta_iv_len);/*--------------------------------------------------------------------------------This function updates several parameters related to the key and the salt for a given session. The session parameter is the value initially obtained with ismaCrypInitSession. A return code of ismacryp_rc_ok indicates successful completion of these functions.In the case of multiple keys for a given session, the get function must be called one time for each key using the value obtained from ismacrypGetKeyCount. In each case of a call to this function, the desired key is indicated in the key_num parameter. Key numbers start at 0 in keeping with common C coding conventions. For example, if the value returned by ismacrypGetKeyCount is 2, ismacrypGetKey would be called twice, once with key_num = 0 and a second time with key_num = 1.For each key the key_len and salt_len parameters are updated with the length of the returned key and the length of the returned salt, respectively. The key and salt pointers are updated to point at buffers containing the key and the salt. These are newly allocated memory which the calling application is responsible for freeing when they are no longer needed.Finally, the lifetime parameter is updated with the lifetime value for the given key.Any return code other than ismacryp_rc_ok means that this functions was called with invalid session identifier or a system error has occurred. In this case the application must assume that the values obtained are incorrect.--------------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -