[Help-gnutls] CRQ signing error

John Brooks aspecialj at gmail.com
Tue Apr 15 03:08:53 CEST 2008


I'm attempting to generate a certificate request with just a common name,
and it seems that gnutls_x509_crq_sign2 is giving me
GNUTLS_E_ASN1_VALUE_NOT_FOUND; i'm not sure what to do about that. As far as
I can see, my code is consistent with the docs and examples. Any pointers on
where this is incorrect?

        if ((re = gnutls_x509_crq_init(&req)) != 0)
        {
            gnutls_x509_privkey_deinit(key);
            return re;
        }

        if ((re = gnutls_x509_crq_set_dn_by_oid(req,
GNUTLS_OID_X520_COMMON_NAME, 0, dn, strlen(dn))) != 0)
        {
            gnutls_x509_crq_deinit(req);
            gnutls_x509_privkey_deinit(key);
            return re;
        }

        if ((re = gnutls_x509_crq_set_key(req, key)) != 0)
        {
            gnutls_x509_crq_deinit(req);
            gnutls_x509_privkey_deinit(key);
            return re;
        }

// This is where the error occurs
        if ((re = gnutls_x509_crq_sign2(req, key, GNUTLS_DIG_SHA1, 0)) != 0)
        {
            gnutls_x509_crq_deinit(req);
            gnutls_x509_privkey_deinit(key);
            return re;
        }

        if ((re = gnutls_x509_crq_export(req, GNUTLS_X509_FMT_PEM, buf,
bufsz)) != 0)
        {
            gnutls_x509_crq_deinit(req);
            gnutls_x509_privkey_deinit(key);
            return re;
        }

Thanks ;)
-- 
- John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20080414/de1e46f5/attachment.htm>


More information about the Gnutls-help mailing list