Example #1
0
static void debugShowSignerInfo(SecCmsSignedDataRef signedData)
{
#ifndef NDEBUG
    int numberOfSigners = SecCmsSignedDataSignerInfoCount (signedData);
    dtprintf("numberOfSigners : %d\n", numberOfSigners);
    int ix;
    for (ix=0;ix < numberOfSigners;ix++)
    {
        SecCmsSignerInfoRef sigi = SecCmsSignedDataGetSignerInfo(signedData,ix);
        if (sigi)
        {
            CFStringRef commonName = SecCmsSignerInfoGetSignerCommonName(sigi);
            const char *signerhdr = "      signer    : ";
            if (commonName)
            {
                char *cn = cfStringToChar(commonName);
                dtprintf("%s%s\n", signerhdr, cn);
                if (cn)
                    free(cn);
                CFReleaseNull(commonName);
            }
            else
                dtprintf("%s<NULL>\n", signerhdr);
         }
    }
#endif
}
Example #2
0
static void debugShowSigningCertificate(SecCmsSignerInfoRef signerinfo)
{
#if SIGINFO_DEBUG
    CFStringRef cn = SecCmsSignerInfoGetSignerCommonName(signerinfo);
    if (cn)
    {
        char *ccn = cfStringToChar(cn);
        if (ccn)
        {
            dprintf("SecCmsSignerInfoVerify: cn: %s\n", ccn);
            free(ccn);
        }
        CFRelease(cn);
    }
#endif
}
Example #3
0
static void debugShowContentTypeOID(SecCmsContentInfoRef contentInfo)
{
#ifndef NDEBUG

    CSSM_OID *typeOID = SecCmsContentInfoGetContentTypeOID(contentInfo);
    if (typeOID)
    {
        CFStringRef oidCFStr = SecDERItemCopyOIDDecimalRepresentation(kCFAllocatorDefault, typeOID);
        char *oidstr = cfStringToChar(oidCFStr);
        printDataAsHex("oid:", typeOID, (unsigned int)typeOID->Length);
        dtprintf("\toid: %s\n", oidstr);
        if (oidCFStr)
            CFRelease(oidCFStr);
        if (oidstr)
            free(oidstr);
    }
#endif
}