class SignedCertificateGenerator {

  public X509Certificate getSelfSigned(final KeyPair keyPair, final CertificateGenerationParameters params) throws Exception {
    final SubjectKeyIdentifier keyIdentifier = getSubjectKeyIdentifierFromKeyInfo(keyPair.getPublic());

    return getSignedByIssuer(
      null,
      keyPair.getPrivate(),
      params.getX500Principal(),
      keyIdentifier,
      keyPair,
      params
    );
  }

  @Autowired  SignedCertificateGenerator(
    final CurrentTimeProvider timeProvider,
    final RandomSerialNumberGenerator serialNumberGenerator,
    final JcaContentSignerBuilder jcaContentSignerBuilder,
    final JcaX509CertificateConverter jcaX509CertificateConverter
  );

}