PcAPI_encrypt_name → int
SYNOPSIS
#include "PcAPIL.h"
int PcAPI_encrypt_name(
int api_sid,
const char *enc_col_name,
unsigned char *src,
int src_len,
unsigned char *dst,
unsigned int *dst_len
);
DESCRIPTION
The PcAPI_encrypt_name function takes in the encryption column name enc_col_name generated by Petra Cipher Key Server and the source data src to encrypt the source data using the specified encryption column. The api_sid parameter should be passed with the session ID returned by calling the PcAPI_getSession function. The session ID is used for communication with Petra Cipher Key Server and is also used for access control to the desired key and user identification in audit data.
The function results in the encrypted data being stored in the dst buffer and the length of the encrypted data being stored in the dst_len parameter. The dst_len parameter should be at least as large as the size of the dst buffer and should be greater than or equal to src_len. Typically, the size of the dst buffer is about twice the size of the src buffer.
However, because the encrypted data in the dst buffer does not have a final value after executing the PcAPI_encrypt_name function, you need to either cut the data from dst by the length of dst_len to use it or indicate the end of the data by setting dst[dst_len] = '\0'
if you want to use the dst buffer directly.
RETURN VALUE
The function returns 0 upon success.
If an error occurs, it returns an error code less than 0.
ERRORS
-30101, -30103, -30106, -30115, -30117, -30301, -30302, -30351, -30388
Feedback
Was this page helpful?
소중한 의견 감사합니다. 귀하의 소중한 의견 부탁드립니다..
피드백을 주시면 더 나은 서비스를 제공할 수 있도록 노력하겠습니다. 귀하의 소중한 의견 부탁드립니다..