// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static CsrBuilder createCsr() {
//   return new CsrBuilderImpl();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static DnBuilder dn() {
//   return new DnBuilderImpl();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static RootCertificate loadRootCertificate(final String keystorePath,
//     final char[] password, final String alias) {
//   return RootCertificateLoader.loadRootCertificate(keystorePath, password, alias);
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/Certificate.java
// public interface Certificate {
// 
//   public X509Certificate getX509Certificate();
// 
//   public String print();
// 
//   public void save(File file);
// 
//   public void save(String fileName);
// 
//   public CertificateWithPrivateKey attachPrivateKey(PrivateKey privateKey);
// 
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CertificateWithPrivateKey.java
// public interface CertificateWithPrivateKey extends Certificate {
// 
//   public KeyStore addToKeystore(KeyStore keyStore, String alias);
// 
//   public KeyStore saveInPkcs12Keystore(String alias);
// 
//   public void exportPkcs12(final String keystorePath, final char[] keystorePassword,
//       final String alias);
// 
//   public void exportPkcs12(final File keystoreFile, final char[] keystorePassword,
//       final String alias);
// 
//   public PrivateKey getPrivateKey();
// 
//   public String printKey();
// 
//   public void saveKey(File file);
// 
//   public void saveKey(String fileName);
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CsrWithPrivateKey.java
// public interface CsrWithPrivateKey extends CSR {
// 
//   public PrivateKey getPrivateKey();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/DistinguishedName.java
// public interface DistinguishedName {
// 
//   public X500Name getX500Name();
// 
//   public X500Principal getX500Principal();
// 
//   public byte[] getEncoded();
// 
//   public String getName();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/RootCertificate.java
// public interface RootCertificate extends CertificateWithPrivateKey {
// 
//   public Signer signCsr(final CSR request);
// 
// }


import static io.github.olivierlemasle.ca.CA.createCsr;
import static io.github.olivierlemasle.ca.CA.dn;
import static io.github.olivierlemasle.ca.CA.loadRootCertificate;
import io.dropwizard.cli.Command;
import io.dropwizard.setup.Bootstrap;
import io.github.olivierlemasle.ca.Certificate;
import io.github.olivierlemasle.ca.CertificateWithPrivateKey;
import io.github.olivierlemasle.ca.CsrWithPrivateKey;
import io.github.olivierlemasle.ca.DistinguishedName;
import io.github.olivierlemasle.ca.RootCertificate;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
package io.github.olivierlemasle.caweb.cli;



public class CreateCertificate extends Command {

  public CreateCertificate() {
    super("createcert", "Creates a signed certificate.");
  }

  @Override
  public void configure(final Subparser parser) {
    parser.addArgument("-s", "--subject")
        .dest("subject")
        .type(String.class)
        .required(true)
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static CsrBuilder createCsr() {
//   return new CsrBuilderImpl();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static DnBuilder dn() {
//   return new DnBuilderImpl();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CA.java
// public static RootCertificate loadRootCertificate(final String keystorePath,
//     final char[] password, final String alias) {
//   return RootCertificateLoader.loadRootCertificate(keystorePath, password, alias);
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/Certificate.java
// public interface Certificate {
// 
//   public X509Certificate getX509Certificate();
// 
//   public String print();
// 
//   public void save(File file);
// 
//   public void save(String fileName);
// 
//   public CertificateWithPrivateKey attachPrivateKey(PrivateKey privateKey);
// 
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CertificateWithPrivateKey.java
// public interface CertificateWithPrivateKey extends Certificate {
// 
//   public KeyStore addToKeystore(KeyStore keyStore, String alias);
// 
//   public KeyStore saveInPkcs12Keystore(String alias);
// 
//   public void exportPkcs12(final String keystorePath, final char[] keystorePassword,
//       final String alias);
// 
//   public void exportPkcs12(final File keystoreFile, final char[] keystorePassword,
//       final String alias);
// 
//   public PrivateKey getPrivateKey();
// 
//   public String printKey();
// 
//   public void saveKey(File file);
// 
//   public void saveKey(String fileName);
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/CsrWithPrivateKey.java
// public interface CsrWithPrivateKey extends CSR {
// 
//   public PrivateKey getPrivateKey();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/DistinguishedName.java
// public interface DistinguishedName {
// 
//   public X500Name getX500Name();
// 
//   public X500Principal getX500Principal();
// 
//   public byte[] getEncoded();
// 
//   public String getName();
// }
// 
// Path: java-ca-lib/src/main/java/io/github/olivierlemasle/ca/RootCertificate.java
// public interface RootCertificate extends CertificateWithPrivateKey {
// 
//   public Signer signCsr(final CSR request);
// 
// }


// Path: ca-api/src/main/java/io/github/olivierlemasle/caweb/cli/CreateCertificate.java
import static io.github.olivierlemasle.ca.CA.createCsr;
import static io.github.olivierlemasle.ca.CA.dn;
import static io.github.olivierlemasle.ca.CA.loadRootCertificate;
import io.dropwizard.cli.Command;
import io.dropwizard.setup.Bootstrap;
import io.github.olivierlemasle.ca.Certificate;
import io.github.olivierlemasle.ca.CertificateWithPrivateKey;
import io.github.olivierlemasle.ca.CsrWithPrivateKey;
import io.github.olivierlemasle.ca.DistinguishedName;
import io.github.olivierlemasle.ca.RootCertificate;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;

package io.github.olivierlemasle.caweb.cli;



public class CreateCertificate extends Command {

  public CreateCertificate() {
    super("createcert", "Creates a signed certificate.");
  }

  @Override
  public void configure(final Subparser parser) {
    parser.addArgument("-s", "--subject")
        .dest("subject")
        .type(String.class)
        .required(true)
        .help("The subject CN");