none
Certreq.exe error: The data is invalid. 0x8007000d RRS feed

  • Question

  • Hi all.

    I want to create a new certificate signing request in PKCS10 format for an existing key (and certificate) in the cert store.

    However, when I ran the certreq command (in PowerShell)

    "certreq.exe -q -new .\renew-request.inf"

    with the following INF file

    ----------------------------

    [NewRequest]
    Subject = "CN=WIN 287454020,C=US"
    RenewalCert = "5e2cc1eebebbc8e36452b9fb2eceb4e9816a6652"
    UseExistingKeySet = true
    RequestType = PKCS10
    SuppressDefaults = true
    MachineKeySet = true

    [Extensions]
    "2.5.29.37" = "{text}1.3.6.1.5.5.7.3.2"

    ----------------------------

    the command returns an error:

    PS C:\Users\Michal\tmp> certreq.exe -q -new .\renew-request.inf
    Certificate Request Processor: The data is invalid. 0x8007000d (WIN32: 13 ERROR_INVALID_DATA)
    .\renew-request.inf
    PS C:\Users\Michal\tmp>

    Any idea what is wrong?

    Thanks!

    Michal


    Monday, September 16, 2019 1:05 PM

Answers

  • Hello,
    Thank you for posting in our TechNet forum.


    From the article certreq, we can see:

    RenewalCert




    So we can try the following INF file:


    [NewRequest]
    Subject = "CN=WIN 287454020,C=US"
    RenewalCert = "5e2cc1eebebbc8e36452b9fb2eceb4e9816a6652"
    UseExistingKeySet = true
    RequestType = PKCS7
    SuppressDefaults = true
    MachineKeySet = true

    [Extensions]
    "2.5.29.37" = "{text}1.3.6.1.5.5.7.3.2"


    OR


    [NewRequest]
    Subject = "CN=WIN 287454020,C=US"
    RenewalCert = "5e2cc1eebebbc8e36452b9fb2eceb4e9816a6652"
    UseExistingKeySet = true
    RequestType = CMC
    SuppressDefaults = true
    MachineKeySet = true

    [Extensions]
    "2.5.29.37" = "{text}1.3.6.1.5.5.7.3.2"



    For example:










    For RequestType = PKCS10, we can request the req.file with certificate template.







    Reference:
    PKCS #10 Request
    https://docs.microsoft.com/en-us/windows/win32/seccertenroll/pkcs--10-request



    Best Regards,
    Daisy Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, September 17, 2019 11:12 AM
    Moderator

All replies