Kit Haines 99c74f5c80
Base Binary Cert and CSR Parse functions. (#24958)
* Base Binary Cert and CSR Parse functions.

* Add otherSANS parsing.

* Notate what doesn't exist on a CSR.

* Fix otherSans call err-checking and add basic-constriants to CSR

* Move BasicConstraint parsing to be optionally set.

* Refactored to use existing ParseBasicConstraintsExtension.

* Add handling for the ChangeSubjectName ext on CSR that is needed for EST

* Remove ChangeSubjectName - it's an attribute, not an extension, and there is no clean way to parse it, so pair down for now.

* Make these public methods, so they can be used in vault.

* Add unit tests for certutil.ParseCertificateToCreationParameters.

Also add unit tests for certutil.ParseCertificateToFields.

* Cleanup TestParseCertificate.

* Add unit tests for certutil.ParseCsrToCreationParameters and ParseCsrToFields.

* Fix return values for  "add_basic_constraints" in certutil.ParseCsrToFields.

Add a test for parsing CSRs where "add_basic_constraints" is false.

* Clear up some todos.

* Add a test for certutil.ParseCertificateToCreationParameters for non-CA cert.

* Tweak TestParseCertificate/full_non_CA_cert.

* Basics of three remaining fields - keyUsage; extKeyUsage; PolicyIdentifiers

* Fix tests and err handling

* Add unit tests for policy_identifiers; ext_key_usage_oids; key_usage

* Add test on ext_key_usage_oids

* Remove duplicate usages elsewhere.

* Add error handling to csr-checks.

* Remove extranames on returned types.

* Remove useless function.

---------

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2024-02-01 10:03:43 -05:00
..
2024-01-26 14:26:21 -05:00
2023-03-15 09:00:52 -07:00
2024-01-18 15:32:43 -05:00
2024-01-18 15:32:43 -05:00
2023-08-10 18:14:03 -07:00

Vault SDK libs

This package provides the sdk package which contains code useful for developing Vault plugins.

Although we try not to break functionality, we reserve the right to reorganize the code at will and may occasionally cause breaks if they are warranted. As such we expect the tag of this module will stay less than v1.0.0.

For any major changes we will try to give advance notice in the CHANGES section of Vault's CHANGELOG.md.