SignDoc SDK (C)
5.0.0
|
Interface for creating an RSA signature. More...
#include <SignDocSDK-c.h>
Public Types | |
typedef SIGNDOC_Boolean(* | SIGNDOC_SignRSA_sign) (void *aClosure, struct SIGNDOC_Source *aSource, const char *aSignatureScheme, const char *aHashAlgorithm, int aSaltLength, struct SIGNDOC_ByteArray *aOutput) |
Callback: Compute an RSA signature. More... | |
typedef int(* | SIGNDOC_SignRSA_getSignatureSize) (void *aClosure) |
Callback: Get the size of the signature that will be computed by SIGNDOC_SignRSA_sign. More... | |
typedef SIGNDOC_Boolean(* | SIGNDOC_SignRSA_getSigningCertificate) (const void *aClosure, struct SIGNDOC_ByteArray *aOutput) |
Callback: Get the signing certificate. More... | |
typedef int(* | SIGNDOC_SignRSA_getCertificateCount) (const void *aClosure) |
Callback: Get the number of available intermediate certificates. More... | |
typedef SIGNDOC_Boolean(* | SIGNDOC_SignRSA_getCertificate) (const void *aClosure, int aIndex, struct SIGNDOC_ByteArray *aOutput) |
Callback: Get an intermediate certificate. More... | |
typedef const char *(* | SIGNDOC_SignRSA_getErrorMessage) (const void *aClosure) |
Callback: Get an error message for the last operation. More... | |
Public Member Functions | |
struct SIGNDOC_SignRSA * | SIGNDOC_SignRSA_new (struct SIGNDOC_Exception **aEx, void *aClosure, SIGNDOC_SignRSA_sign aSign, SIGNDOC_SignRSA_getSignatureSize aGetSignatureSize, SIGNDOC_SignRSA_getSigningCertificate aGetSigningCertificate, SIGNDOC_SignRSA_getCertificateCount aGetCertificateCount, SIGNDOC_SignRSA_getCertificate aGetCertificate, SIGNDOC_SignRSA_getErrorMessage aGetErrorMessage) |
SIGNDOC_SignRSA constructor. More... | |
void | SIGNDOC_SignRSA_delete (struct SIGNDOC_SignRSA *aObj) |
SIGNDOC_SignRSA destructor. More... | |
Interface for creating an RSA signature.
Selection of the certificate is up to the implementation.
typedef SIGNDOC_Boolean( * SIGNDOC_SignRSA_getCertificate) (const void *aClosure, int aIndex, struct SIGNDOC_ByteArray *aOutput) |
Callback: Get an intermediate certificate.
[in] | aClosure | A pointer to user-defined object. |
[in] | aIndex | The zero-based index of the intermediate certificate, see SIGNDOC_SignRSA_getCertificateCount(). |
[in,out] | aOutput | The requested intermediate certificate shall be stored here (DER-encoded X.509). |
typedef int( * SIGNDOC_SignRSA_getCertificateCount) (const void *aClosure) |
Callback: Get the number of available intermediate certificates.
[in] | aClosure | A pointer to user-defined object. |
typedef const char*( * SIGNDOC_SignRSA_getErrorMessage) (const void *aClosure) |
Callback: Get an error message for the last operation.
After any function pointer of the SIGNDOC_SignRSA object has been called, this function shall return an error message (possibly empty if the most recently called function pointer didn't fail).
[in] | aClosure | A pointer to user-defined object. |
typedef int( * SIGNDOC_SignRSA_getSignatureSize) (void *aClosure) |
Callback: Get the size of the signature that will be computed by SIGNDOC_SignRSA_sign.
[in] | aClosure | A pointer to user-defined object. |
typedef SIGNDOC_Boolean( * SIGNDOC_SignRSA_getSigningCertificate) (const void *aClosure, struct SIGNDOC_ByteArray *aOutput) |
Callback: Get the signing certificate.
[in] | aClosure | A pointer to user-defined object. |
[in,out] | aOutput | The signing certificate shall be stored here (DER-encoded X.509). |
typedef SIGNDOC_Boolean( * SIGNDOC_SignRSA_sign) (void *aClosure, struct SIGNDOC_Source *aSource, const char *aSignatureScheme, const char *aHashAlgorithm, int aSaltLength, struct SIGNDOC_ByteArray *aOutput) |
Callback: Compute an RSA signature.
[in] | aClosure | A pointer to user-defined object. |
[in] | aSource | An object providing data to be hashed and signed. |
[in] | aSignatureScheme | The RSA signature scheme:
|
[in] | aHashAlgorithm | The Hash algorithm to be used for the signature and (for RSASSA-PSS) for mask generation:
|
[in] | aSaltLength | The salt length (in octets) for RSASSA-PSS, to be ignored for teh PKCS #1 padding scheme. |
[in,out] | aOutput | The RSA signature shall be stored here. This shall be just the result of the RSA operation, not wrapped in an OCTET STRING. |
void SIGNDOC_SignRSA_delete | ( | struct SIGNDOC_SignRSA * | aObj | ) |
SIGNDOC_SignRSA destructor.
[in] | aObj | A pointer to the SIGNDOC_SignRSA object. |
struct SIGNDOC_SignRSA * SIGNDOC_SignRSA_new | ( | struct SIGNDOC_Exception ** | aEx, |
void * | aClosure, | ||
SIGNDOC_SignRSA_sign | aSign, | ||
SIGNDOC_SignRSA_getSignatureSize | aGetSignatureSize, | ||
SIGNDOC_SignRSA_getSigningCertificate | aGetSigningCertificate, | ||
SIGNDOC_SignRSA_getCertificateCount | aGetCertificateCount, | ||
SIGNDOC_SignRSA_getCertificate | aGetCertificate, | ||
SIGNDOC_SignRSA_getErrorMessage | aGetErrorMessage | ||
) |
SIGNDOC_SignRSA constructor.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aClosure | A pointer to user-defined object that will be passed to the callbacks. |
[in] | aSign | Pointer to function implementing sign(). |
[in] | aGetSignatureSize | Pointer to function implementing getSignatureSize(). |
[in] | aGetSigningCertificate | Pointer to function implementing getSigningCertificate(). |
[in] | aGetCertificateCount | Pointer to function implementing getCertificateCount(). |
[in] | aGetCertificate | Pointer to function implementing getCertificate(). |
[in] | aGetErrorMessage | Pointer to function implementing getErrorMessage(). |