Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Constraints certificate extension #68

Open
SteelCrow opened this issue Nov 29, 2021 · 2 comments
Open

Basic Constraints certificate extension #68

SteelCrow opened this issue Nov 29, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@SteelCrow
Copy link

For Basic Constraints certificate extension currently rcgen support two options:

pub enum IsCa {
    SelfSignedOnly,
    Ca(BasicConstraints)
}

And if we look into spec we will see exactly these two options:

id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 }

   BasicConstraints ::= SEQUENCE {
        cA                      BOOLEAN DEFAULT FALSE,
        pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
and extension identifies two aspects:

Subject type: is the certificate a CA certificate or it is an end entity certificate;
[Optionally] How many CAs are allowed in the chain below current CA certificate. This setting has no meaning for end entity certificates.

And for sure Ca(x) case generate something like:

SubjectType=CA
Path length Constraint = x

But in case of SelfSignedOnly it didn't generate anything.

Empty

Despite spec said: "If Basic Constraints extension is not included in certificate, it is automatically treated as end entity certificate."

Is it possible to force writing this field?

SubjectType=End Entity
Path length Constraint = None
@est31
Copy link
Member

est31 commented Nov 29, 2021

Good point!

@est31 est31 added the enhancement New feature or request label Nov 29, 2021
@est31
Copy link
Member

est31 commented Nov 29, 2021

Right now the only way to implement it in the API is to do a custom extension and serialize it yourself, but we could have native support by e.g. having a EndEntity variant of the enum.

@cpu cpu mentioned this issue Dec 8, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants