SignDoc SDK (C)  5.0.0
SIGNDOC_SignECDSA Class Reference

Interface for creating an ECDSA signature. More...

#include <SignDocSDK-c.h>

Public Types

typedef SIGNDOC_Boolean(* SIGNDOC_SignECDSA_sign) (void *aClosure, struct SIGNDOC_Source *aSource, const char *aHashAlgorithm, struct SIGNDOC_ByteArray *aOutput)
 Callback: Compute an ECDSA signature. More...
 
typedef int(* SIGNDOC_SignECDSA_getSignatureSize) (void *aClosure)
 Callback: Get the size of the signature that will be computed by SIGNDOC_SignECDSA_sign. More...
 
typedef SIGNDOC_Boolean(* SIGNDOC_SignECDSA_getSigningCertificate) (const void *aClosure, struct SIGNDOC_ByteArray *aOutput)
 Callback: Get the signing certificate. More...
 
typedef int(* SIGNDOC_SignECDSA_getCertificateCount) (const void *aClosure)
 Callback: Get the number of available intermediate certificates. More...
 
typedef SIGNDOC_Boolean(* SIGNDOC_SignECDSA_getCertificate) (const void *aClosure, int aIndex, struct SIGNDOC_ByteArray *aOutput)
 Callback: Get an intermediate certificate. More...
 
typedef const char *(* SIGNDOC_SignECDSA_getErrorMessage) (const void *aClosure)
 Callback: Get an error message for the last operation. More...
 

Public Member Functions

struct SIGNDOC_SignECDSASIGNDOC_SignECDSA_new (struct SIGNDOC_Exception **aEx, void *aClosure, SIGNDOC_SignECDSA_sign aSign, SIGNDOC_SignECDSA_getSignatureSize aGetSignatureSize, SIGNDOC_SignECDSA_getSigningCertificate aGetSigningCertificate, SIGNDOC_SignECDSA_getCertificateCount aGetCertificateCount, SIGNDOC_SignECDSA_getCertificate aGetCertificate, SIGNDOC_SignECDSA_getErrorMessage aGetErrorMessage)
 SIGNDOC_SignECDSA constructor. More...
 
void SIGNDOC_SignECDSA_delete (struct SIGNDOC_SignECDSA *aObj)
 SIGNDOC_SignECDSA destructor. More...
 

Detailed Description

Interface for creating an ECDSA signature.

Selection of the certificate is up to the implementation.

Member Typedef Documentation

typedef SIGNDOC_Boolean( * SIGNDOC_SignECDSA_getCertificate) (const void *aClosure, int aIndex, struct SIGNDOC_ByteArray *aOutput)

Callback: Get an intermediate certificate.

Parameters
[in]aClosureA pointer to user-defined object.
[in]aIndexThe zero-based index of the intermediate certificate, see SIGNDOC_SignECDSA_getCertificateCount().
[in,out]aOutputThe requested intermediate certificate shall be stored here (DER-encoded X.509).
Returns
SIGNDOC_TRUE if successful, SIGNDOC_FALSE on error.
typedef int( * SIGNDOC_SignECDSA_getCertificateCount) (const void *aClosure)

Callback: Get the number of available intermediate certificates.

Parameters
[in]aClosureA pointer to user-defined object.
Returns
The number of available intermediate certificates.
typedef const char*( * SIGNDOC_SignECDSA_getErrorMessage) (const void *aClosure)

Callback: Get an error message for the last operation.

After any function pointer of the SIGNDOC_SignECDSA object has been called, this function shall return an error message (possibly empty if the most recently called function pointer didn't fail).

Parameters
[in]aClosureA pointer to user-defined object.
Returns
A pointer to the error message. The caller assumes that the pointer may bcome invalid as soon as any function pointer of the SIGNDOC_SignECDSA object is called or that object is destroyed.
typedef int( * SIGNDOC_SignECDSA_getSignatureSize) (void *aClosure)

Callback: Get the size of the signature that will be computed by SIGNDOC_SignECDSA_sign.

Parameters
[in]aClosureA pointer to user-defined object.
Returns
The size in octets of the signature that will be computed by SIGNDOC_SignECDSA_sign or a negative value on error.
typedef SIGNDOC_Boolean( * SIGNDOC_SignECDSA_getSigningCertificate) (const void *aClosure, struct SIGNDOC_ByteArray *aOutput)

Callback: Get the signing certificate.

Parameters
[in]aClosureA pointer to user-defined object.
[in,out]aOutputThe signing certificate shall be stored here (DER-encoded X.509).
Returns
SIGNDOC_TRUE if successful, SIGNDOC_FALSE on error.
typedef SIGNDOC_Boolean( * SIGNDOC_SignECDSA_sign) (void *aClosure, struct SIGNDOC_Source *aSource, const char *aHashAlgorithm, struct SIGNDOC_ByteArray *aOutput)

Callback: Compute an ECDSA signature.

Parameters
[in]aClosureA pointer to user-defined object.
[in]aSourceAn object providing data to be hashed and signed.
[in]aHashAlgorithmThe hash algorithm to be used for the signature:
  • "SHA-1"
  • "SHA-224"
  • "SHA-256"
  • "SHA-384"
  • "SHA-512"
[in,out]aOutputThe ECDSA signature (a DER-encoded SEQUENCE) shall be stored here. It shall not be wrapped in an OCTET STRING.
Returns
SIGNDOC_TRUE if successful, SIGNDOC_FALSE on error.

Member Function Documentation

void SIGNDOC_SignECDSA_delete ( struct SIGNDOC_SignECDSA aObj)

SIGNDOC_SignECDSA destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_SignECDSA object.
struct SIGNDOC_SignECDSA * SIGNDOC_SignECDSA_new ( struct SIGNDOC_Exception **  aEx,
void *  aClosure,
SIGNDOC_SignECDSA_sign  aSign,
SIGNDOC_SignECDSA_getSignatureSize  aGetSignatureSize,
SIGNDOC_SignECDSA_getSigningCertificate  aGetSigningCertificate,
SIGNDOC_SignECDSA_getCertificateCount  aGetCertificateCount,
SIGNDOC_SignECDSA_getCertificate  aGetCertificate,
SIGNDOC_SignECDSA_getErrorMessage  aGetErrorMessage 
)

SIGNDOC_SignECDSA constructor.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aClosureA pointer to user-defined object that will be passed to the callbacks.
[in]aSignPointer to function implementing sign().
[in]aGetSignatureSizePointer to function implementing getSignatureSize().
[in]aGetSigningCertificatePointer to function implementing getSigningCertificate().
[in]aGetCertificateCountPointer to function implementing getCertificateCount().
[in]aGetCertificatePointer to function implementing getCertificate().
[in]aGetErrorMessagePointer to function implementing getErrorMessage().
Returns
A pointer to a new SIGNDOC_SignECDSA object.
See also
SIGNDOC_SignECDSA_delete()

The documentation for this class was generated from the following file: