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

Are the compatibility settings for certificate templates in the object returned by Get-CertificateTemplate? #207

Open
bencoremans opened this issue Feb 1, 2024 · 4 comments
Labels
question This is a general question.

Comments

@bencoremans
Copy link

Is the Private Key Flag (msPKI-Private-Key-Flag) attribute available in the object returned by the Get-CertificateTemplate cmdlet in the PSPKI module?

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 1, 2024

Yes, it is under $template.Settings.Cryptography.PrivateKeyOptions

@bencoremans
Copy link
Author

What I'm aiming to understand is the process of reconstructing a certificate template's original configuration using the object returned by the Get-CertificateTemplate cmdlet. Specifically, I'm interested in identifying the necessary attributes that would allow me to determine the original settings through a Bitwise OR operation. Could you provide some insights or guidance on which attributes are crucial for this task and how they might be used to achieve the desired outcome?

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 5, 2024

You may need to reverse the DS attribute decomposition back from properties to DS attributes.

@bencoremans
Copy link
Author

Thank you for your guidance on reversing the DS attribute decomposition from properties back to DS attributes. To follow up on that, I'm trying to understand how to extract and reconstruct the original values of specific flags, such as the msPKI-Private-Key-Flag, from the output of the Get-CertificateTemplate cmdlet.

For example, the msPKI-Private-Key-Flag for a template is set to 101056768, which encompasses various flags like TEMPLATE_CLIENT_VER_THRESHOLD, TEMPLATE_SERVER_VER_THRESHOLD, CTPRIVATEKEY_FLAG_USE_LEGACY_PROVIDER, and CTPRIVATEKEY_FLAG_ATTEST_NONE.

Could you advise on how to interpret the cmdlet's output, to derive these flag values? Are there specific attributes in the cmdlet's output that correspond to these flags, and if so, how can they be used to reconstruct the original msPKI-Private-Key-Flag value?

@Crypt32 Crypt32 added the question This is a general question. label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a general question.
Projects
None yet
Development

No branches or pull requests

2 participants