-
Notifications
You must be signed in to change notification settings - Fork 30
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
There was a problem hiding this 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")); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Basic sanity tests for both of JSS's PKCS#10 interfaces.