-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split CertificationRequest test into separate file
Signed-off-by: Alexander Scheel <[email protected]>
- Loading branch information
Showing
2 changed files
with
33 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.mozilla.jss.tests; | ||
|
||
import java.io.*; | ||
import java.security.KeyPair; | ||
|
||
import org.mozilla.jss.*; | ||
import org.mozilla.jss.asn1.*; | ||
import org.mozilla.jss.crypto.*; | ||
import org.mozilla.jss.pkcs10.*; | ||
import org.mozilla.jss.pkix.primitive.*; | ||
|
||
public class TestCertificationRequest { | ||
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); | ||
} | ||
|
||
CryptoManager cm = CryptoManager.getInstance(); | ||
|
||
CertificationRequest cert; | ||
|
||
// read in a cert | ||
FileInputStream fis = new FileInputStream(argv[1]); | ||
try (BufferedInputStream bis = new BufferedInputStream(fis)) { | ||
cert = (CertificationRequest) CertificationRequest.getTemplate().decode(bis); | ||
} | ||
|
||
CertificationRequestInfo info = cert.getInfo(); | ||
|
||
info.print(System.out); | ||
} | ||
} |