@Override
  protected void configure(final IdentityCapabilityConfiguration config) throws Exception {
    // Generate identity key-pair if not already created
    if (!keyStoreManager.isKeyPairInitialized()) {
      log.info("Generating identity certificate");

      // For now give something unique to the cert for additional identification purposes
      UUID cn = UUID.randomUUID();
      keyStoreManager.generateAndStoreKeyPair(
          cn.toString(), "Nexus", "Sonatype", "Silver Spring", "MD", "US");
    }

    Certificate cert = certificate();
    log.trace("Certificate:\n{}", cert);

    fingerprint = CertificateUtil.calculateFingerprint(cert);
    log.debug("Fingerprint: {}", fingerprint);
  }
 public String certificateAsPem() throws Exception {
   return CertificateUtil.serializeCertificateInPEM(certificate());
 }