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

Enhancement to the CLI: CaImportCertDirCommand.java #711

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Stueypoo
Copy link
Contributor

  • Added an option to use an alternate CA certificate.

When importing certificates into a newly migrated CA, the code performs a certificate verification based upon the CA's certificate that is stored in the DB. A problem with this is when the certificates being imported had been issued from the CA's previous certificate. An example CA that is impacted by this is a CSCA used for ePassports. These CA are renewed often, and the end-entity certificate have a long validity.

To remedy this, I added a "--cacert" option that allows the Operator to provide an alternate CA certificate that will then be used to verify the certificate being imported.

  • Added an option to get the revocation details from the filename.

When importing revoked certificates, the Operator should supply the revocation REASON and INVALIDITY_TIME. If you have a lot of revoked certificates to import, then a better option is required.

One idea is to have the REASON and TIME value encoded within the filename of each certificate, and the code then extracts these revocation details. The filename format being: CertName_REASON_TIME

REASON is the reason code value or the name. eg., For suspended certs, use either "6" or "CERTIFICATEHOLD"
TIME format is YYYY.MM.DD-hh:mm

Checklist before requesting a review

  • [X ] I have performed a self-review of my code
  • [X ] I have kept the patch limited to only change the parts related to the patch
  • This change requires a documentation update

Added an option to use an alternate CA certificate.
Added an option to get the revocation details from the filename.
@primetomas
Copy link
Collaborator

Awesome, thank you. There is a system test for this command in modules/systemtests/src-test/org/ejbca/ui/cli/ca/CaImportCertCommandSystemTest.java

Can you add some testing of the new parameters there?

You can easily run the test with

ant test:runone -Dtest.runone=CaImportCertCommandSystemTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants