Getting CRYPT_ERROR_INVALID when attempting to have the CA issue a certificate

Ed Curren <[email protected]>
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
Hi Peter,
I am having a problem issuing a certificate from a CA.  When I call the 
cryptCACertManagement below it is returning a -26 as the result.  I cannot
get an error locus or error type from them (they both return 0).  

In the code below the 'buffer' variable is a char[] that holds the certificate request
created in a different function and passed here.  

I'm stumped and could really use a hand.

Thanks very much.

    CRYPT_KEYSET keyset;
    CRYPT_KEYSET caKey;
    CRYPT_CONTEXT caPrivateKey;
    CRYPT_CERTIFICATE certificate;
    CRYPT_CERTIFICATE issuedCert;
    
    result = cryptKeysetOpen(&caKey, CRYPT_UNUSED, CRYPT_KEYSET_FILE, 
        Configuration::Instance().GetCaKeypairFileName().c_str(), CRYPT_KEYOPT_NONE);

    result = cryptKeysetOpen(&keyset, CRYPT_UNUSED, CRYPT_KEYSET_DATABASE_STORE,     
        Configuration::Instance().GetCaCertificateDatabase().c_str(), CRYPT_KEYOPT_NONE);

    result = cryptImportCert(buffer, decodedCertLength, CRYPT_UNUSED, &certificate);

    result = cryptCAAddItem(keyset, certificate);

    result = cryptGetPrivateKey(caKey, &caPrivateKey, CRYPT_KEYID_NAME, 
        Configuration::Instance().GetCaKeypairKeyLabel().c_str(), "password");

    result = cryptCACertManagement(&issuedCert, CRYPT_CERTACTION_ISSUE_CERT, keyset, caPrivateKey, certificate);

_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.