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

📄 sc_pkcs15_compute_signature.3

📁 读写Smart卡加解密接口的程序
💻 3
字号:
.TH sc_pkcs15_compute_signature 3 "July 2003" "OpenSC Programmer's Manual.SH NAMEsc_pkcs15_compute_signature \- compute digitial signature.SH SYNOPSIS.nf.B #include <opensc.h>.sp.BI "int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card,.BI "                   const struct sc_pkcs15_object *obj,.BI "                   unsigned long flags, const u8 *in, size_t inlen,.BI "                   u8 *out, size_t outlen);.fi.SH DESCRIPTIONThis function digitally signs the data pointed to by.BR in ,using the key identified by.BR obj , and places the resulting signature in the buffer pointed to by.BR out .The signature operation will be performed on the smart cardidentified by.BR p15card ..PPCurrently, only RSA signatures are supported..PPThe.B flagsargument provides additional information on how the signature isto be computed. In particular, it specifies how the input datashould be padded:.TP.B SC_ALGORITHM_RSA_RAWrequests that the card should sign the provided data as-is.The length of the input data must match the modulus lengthof the key..TP.B SC_ALGORITHM_RSA_PAD_PKCS1requests that the card should sign the provided data,padding it according to the padding algorithm specifiedin PKCS#1..IPThe input data must be the output of a digest (hash) function.As PKCS#1 padding includes an identifier of the hash algorithmused, the.B flagsargument must indicate the hash algorithm used,by ORing.B SC_ALGORITHM_RSA_PAD_PKCS1with one of the following values:.BR SC_ALGORITHM_RSA_HASH_MD5 ,.BR SC_ALGORITHM_RSA_HASH_SHA1 ,.BR SC_ALGORITHM_RSA_HASH_RIPEMD160 ,.BR SC_ALGORITHM_RSA_HASH_MD5_SHA1 , or.BR SC_ALGORITHM_RSA_HASH_NONE ..IPIn any of these cases, the length of the input data must matchthe digest length of the hash algorithm. In the first 3 cases,the respective digestinfo is prepended to the input data (thehash), in the last 2 cases, no digestinfo is prepended..TP.B SC_ALGORITHM_RSA_PAD_ANSIrequests that the card should use ANSI padding when signing theprovided data..TP.B SC_ALGORITHM_RSA_PAD_ISO9796requests that the card should use ISO 9796 padding when signing theprovided data..\".\".\".SH Card Driver ConsiderationsDepending on the card's capabilities,.B sc_pkcs15_compute_signatureis able to process the provided data so that it is in a formsuitable for the card. For instance, if a smart card supportsraw RSA only, the function will have to add the requiredpadding before passing it to the card driver.Conversely, an error should be returned if the card supportsonly PKCS#1 padding with a specific set of hash algorithms..PP....SH RETURN VALUEIf an error occurred, a negative error code is returned, as describedin \fbsc_error\fP(3). Otherwise, the function will return thesize of the signature..SH SEE ALSO.BR sc_pkcs15_decipher (3),.BR sc_compute_signature (3)..SH AUTHORThis manual page was written by Olaf Kirch <okir@suse.de>

⌨️ 快捷键说明

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