Skip to content

step ca does not honor all attributes in x509 template #674

Answered by tashian
sephiroth1395 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sephiroth1395,

The template JSON file needs to be part of your CA configuration, you can't pass a template in via step ca sign.
What --set-file can be used for is a dictionary of key-value pairs that then can be accessed in the CA's template via Insecure.User.* variables.

So, in your case, in your CA you'll want a template that looks sort of like this:

{
    "subject": {{ toJson .Subject }},
    "sans": {{ toJson .SANs }},
    "keyUsage": ["certSign", "crlSign"],
    "basicConstraints": {
        "isCA": true,
        "maxPathLen": 0
    }
}

(I haven't tested this, but this is the idea.)
You put this into a .tpl file (somewhere like /etc/step-ca/templates/x509) and refer to it from y…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tashian
Comment options

tashian Aug 11, 2021
Collaborator

@sephiroth1395
Comment options

@sephiroth1395
Comment options

@tashian
Comment options

tashian Aug 16, 2021
Collaborator

Answer selected by sephiroth1395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #673 on August 11, 2021 22:25.