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 tests for PKCS#10 #556

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

cipherboy
Copy link
Member

Basic sanity tests for both of JSS's PKCS#10 interfaces.

@cipherboy cipherboy added CI Changes related to the CI system or Dockerfiles minor Changes which fix minor bugs labels May 18, 2020
@cipherboy cipherboy added this to the 4.7.0 milestone May 18, 2020
@cipherboy cipherboy requested a review from edewata May 18, 2020 16:49
@cipherboy cipherboy self-assigned this May 18, 2020
Copy link
Contributor

@edewata edewata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions below, but that can be addressed later. Feel free to merge.


CertAndKeyGen ckg = new CertAndKeyGen("RSA", "SHA256withRSA");
ckg.generate(4096);
PKCS10 csr = ckg.getCertRequest(new X500Name("CN=localhost"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add some validations for the CSR?

public static void main(String[] argv) throws Exception {
if (argv.length > 2 || argv.length < 1) {
System.out.println("Usage: TestCertificationRequest <dbdir> [<certfile>]");
System.exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should generate a non-zero return code since it fails the test.

import org.mozilla.jss.pkcs10.*;
import org.mozilla.jss.pkix.primitive.*;

public class TestCertificationRequest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we run this test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it requires a CSR to run so I ran it manually. We didn't previously run this test either, but it at least moves it into the correct place in case we want to run it automatically in the future. I think this test should/could be expanded with actual uses of these classes from Dogtag PKI, but we should leave it for a future sprint and/or QE to do.

@cipherboy cipherboy removed this from the 4.7.0 milestone Jun 23, 2020
@cipherboy cipherboy removed their assignment Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Changes related to the CI system or Dockerfiles minor Changes which fix minor bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants