Sample code for 30+ languages & platforms
C

Example: Crypt2.GetSignatureSigningTimeStr method

Demonstrates how to call the GetSignatureSigningTimeStr method.

Chilkat C Downloads

C
#include <C_CkCrypt2.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkCrypt2 crypt;
    int numSigners;
    int i;

    success = FALSE;

    crypt = CkCrypt2_Create();

    success = CkCrypt2_VerifyP7M(crypt,"qa_data/cades/CAdES-T/Signature-C-T-1.p7m","qa_output/out.dat");
    if (success == FALSE) {
        printf("%s\n",CkCrypt2_lastErrorText(crypt));
        CkCrypt2_Dispose(crypt);
        return;
    }

    numSigners = CkCrypt2_getNumSignerCerts(crypt);
    printf("Num Signers = %d\n",numSigners);

    i = 0;
    while (i < numSigners) {
        if (CkCrypt2_HasSignatureSigningTime(crypt,i) == TRUE) {
            printf("%d: %s\n",i + 1,CkCrypt2_getSignatureSigningTimeStr(crypt,i));
        }
        else {
            printf("%d: has no signing time.\n",i + 1);
        }

        i = i + 1;
    }

    //  Sample output:

    //  Num Signers = 1
    //  1: Sun, 03 Dec 2013 06:57:41 GMT


    CkCrypt2_Dispose(crypt);

    }