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

📄 sta_r_w.c

📁 SecuDe是一个由安全应用程序接口组成,对验证机制、证件处理、PEM、X.400报文处理和密钥管理提供支持。SecuDe提供DES、 RSA杂凑函数、密钥生成以及数字签名的生成和核实等多种密码机制。
💻 C
📖 第 1 页 / 共 4 页
字号:
/*                               ECLERR                        *//*                               ERDERR                        *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*							       *//*  cr_header         	       ERROR-Codes    		       *//*                               M_ESECMESS		       *//*							       *//*							       *//*  create_trans   	       ERROR-Codes	               *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               EMEMAVAIL		       *//*                               ESIDUNK                       *//*                               EPARMISSED                    *//*			         EPARINC		       *//*                               INVPAR                        *//*                               EINVINS                       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*                               sw1/sw2 from SC  response     *//*							       *//*-------------------------------------------------------------*/intsca_delete_record(sct_id, file_id, record_id, sec_mess)	int             sct_id;	FileId         *file_id;	unsigned int    record_id;	SecMess        *sec_mess;{	/*----------------------------------------------------------*/	/* Definitions					       */	/*----------------------------------------------------------*/	/*----------------------------------------------------------*/	/* Statements					       */	/*----------------------------------------------------------*/#ifdef TEST	fprintf(stdout, "\n***** STAMOD-Routine sca_delete_record *****\n\n");	fprintf(stdout, "TRACE of the input parameters : \n");	fprintf(stdout, "sct_id                  : %d\n", sct_id);	print_fileid(file_id);	fprintf(stdout, "record_id               : %d\n", record_id);	print_secmess(sec_mess);#endif	/*-------------------------------------*/	/* call check_sct_sc                  */	/*-------------------------------------*/	if (check_sct_sc(sct_id, TRUE))		return (-1);	/*-------------------------------------*/	/* create SC command LOCKF            */	/*-------------------------------------*/	/* create header                       */	if (cr_header(SC_DELREC, sec_mess))		return (-1);	/* set parameters			  */	SCDELREC.fid = file_id;	SCDELREC.rid = record_id;	/* call create_trans			  */	if (create_trans(sct_id, TRUE))		return (-1);	/*----------------------------------------------*/	/* normal end => release response storage       */	/*----------------------------------------------*/	sta_aux_bytestr_free(&response);#ifdef TEST	fprintf(stdout, "\n***** Normal end of   sca_delete_record *****\n\n");#endif	return (0);}/*-------------------------------------------------------------*//* E N D   O F	 P R O C E D U R E	sca_delete_record      *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//*						         | GMD *//*						         +-----*//* PROC  sca_lock_key             VERSION   1.0	    	       *//*				     DATE   Januar 1992	       *//*			      	       BY   Levona Eckstein    *//*							       *//* DESCRIPTION						       *//*  Lock key on smartcard.              	               *//*							       *//*							       *//* IN			     DESCRIPTION		       *//*   sct_id		       SCT identifier		       *//*                                                             *//*   key_id                    Key identifier                  *//*							       */ /* sec_mess		       security modes                  *//* *//* OUT							       *//*							       *//*							       *//* RETURN		     DESCRIPTION	      	       *//*   0	         	       o.k			       *//*  -1			       error			       *//*							       *//* CALLED FUNCTIONS					       *//*  check_sct_sc               ERROR-Codes		       *//*			         ENOCARD		       *//*			         ESIDUNK		       *//*			 	 ENOSHELL		       *//*                               EOPERR                        *//*			         EEMPTY                        *//*                               EMEMAVAIL                     *//*                               ECLERR                        *//*                               ERDERR                        *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*							       *//*  cr_header         	       ERROR-Codes    		       *//*                               M_ESECMESS		       *//*							       *//*							       *//*  create_trans   	       ERROR-Codes	               *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               EMEMAVAIL		       *//*                               ESIDUNK                       *//*                               EPARMISSED                    *//*			         EPARINC		       *//*                               INVPAR                        *//*                               EINVINS                       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*                               sw1/sw2 from SC  response     *//*							       *//*-------------------------------------------------------------*/intsca_lock_key(sct_id, key_id, sec_mess)	int             sct_id;	KeyId          *key_id;	SecMess        *sec_mess;{	/*----------------------------------------------------------*/	/* Definitions					       */	/*----------------------------------------------------------*/	/*----------------------------------------------------------*/	/* Statements					       */	/*----------------------------------------------------------*/#ifdef TEST	fprintf(stdout, "\n***** STAMOD-Routine sca_lock_key *****\n\n");	fprintf(stdout, "TRACE of the input parameters : \n");	fprintf(stdout, "sct_id                  : %d\n", sct_id);	print_keyid(key_id);	print_secmess(sec_mess);#endif	/*-------------------------------------*/	/* call check_sct_sc                  */	/*-------------------------------------*/	if (check_sct_sc(sct_id, TRUE))		return (-1);	/*-------------------------------------*/	/* create SC command LOCKF            */	/*-------------------------------------*/	/* create header                       */	if (cr_header(SC_LOCKKEY, sec_mess))		return (-1);	/* set parameters			  */	SCLOCKK.kid = key_id;	SCLOCKK.operation = CO_LOCK;	/* call create_trans			  */	if (create_trans(sct_id, TRUE))		return (-1);	/*----------------------------------------------*/	/* normal end => release response storage       */	/*----------------------------------------------*/	sta_aux_bytestr_free(&response);#ifdef TEST	fprintf(stdout, "\n***** Normal end of   sca_lock_key *****\n\n");#endif	return (0);}/*-------------------------------------------------------------*//* E N D   O F	 P R O C E D U R E	sca_lock_key	       *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//*						         | GMD *//*						         +-----*//* PROC  sca_unlock_key           VERSION   1.0	    	       *//*				     DATE   Januar 1992	       *//*			      	       BY   Levona Eckstein    *//*							       *//* DESCRIPTION						       *//*  Unlock key on the smartcard.         	               *//*							       *//*							       *//* IN			     DESCRIPTION		       *//*   sct_id		       SCT identifier		       *//*                                                             *//*   key_id                    Key identifier                  *//*							       */ /* sec_mess		       security modes                  *//* *//* OUT							       *//*							       *//*							       *//* RETURN		     DESCRIPTION	      	       *//*   0	         	       o.k			       *//*  -1			       error			       *//*							       *//* CALLED FUNCTIONS					       *//*  check_sct_sc               ERROR-Codes		       *//*			         ENOCARD		       *//*			         ESIDUNK		       *//*			 	 ENOSHELL		       *//*                               EOPERR                        *//*			         EEMPTY                        *//*                               EMEMAVAIL                     *//*                               ECLERR                        *//*                               ERDERR                        *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*							       *//*  cr_header         	       ERROR-Codes    		       *//*                               M_ESECMESS		       *//*							       *//*							       *//*  create_trans   	       ERROR-Codes	               *//*                               EINVARG		       *//*                               ETOOLONG		       *//*                               EMEMAVAIL		       *//*                               ESIDUNK                       *//*                               EPARMISSED                    *//*			         EPARINC		       *//*                               INVPAR                        *//*                               EINVINS                       *//*                               sw1/sw2 from SCT response     *//*                               T1 - ERROR                    *//*                               sw1/sw2 from SC  response     *//*							       *//*-------------------------------------------------------------*/intsca_unlock_key(sct_id, key_id, sec_mess)	int             sct_id;	KeyId          *key_id;	SecMess        *sec_mess;{	/*----------------------------------------------------------*/	/* Definitions					       */	/*----------------------------------------------------------*/	/*----------------------------------------------------------*/	/* Statements					       */	/*----------------------------------------------------------*/#ifdef TEST	fprintf(stdout, "\n***** STAMOD-Routine sca_unlock_key *****\n\n");	fprintf(stdout, "TRACE of the input parameters : \n");	fprintf(stdout, "sct_id                  : %d\n", sct_id);	print_keyid(key_id);	print_secmess(sec_mess);#endif	/*-------------------------------------*/	/* call check_sct_sc                  */	/*-------------------------------------*/	if (check_sct_sc(sct_id, TRUE))		return (-1);	/*-------------------------------------*/	/* create SC command LOCKF            */	/*-------------------------------------*/	/* create header                       */	if (cr_header(SC_LOCKKEY, sec_mess))		return (-1);	/* set parameters			  */	SCLOCKK.kid = key_id;	SCLOCKK.operation = CO_UNLOCK;	/* call create_trans			  */	if (create_trans(sct_id, TRUE))		return (-1);	/*----------------------------------------------*/	/* normal end => release response storage       */	/*----------------------------------------------*/	sta_aux_bytestr_free(&response);#ifdef TEST	fprintf(stdout, "\n***** Normal end of   sca_unlock_key *****\n\n");#endif	return (0);}/*-------------------------------------------------------------*//* E N D   O F	 P R O C E D U R E	sca_unlock_key	       *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//* E N D   O F	 P A C K A G E	     STAMOD-stasc 	       *//*-------------------------------------------------------------*/

⌨️ 快捷键说明

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