code: @Nonnull
    @Nonempty
    public static String getPEMEncodedCertificate (@Nonnull final Certificate aCert)
    {
      ValueEnforcer.notNull (aCert, "Cert");
      try
      {
        final String sEncodedCert = Base64.encodeBytes (aCert.getEncoded ());
        return BEGIN_CERTIFICATE + "\n" + sEncodedCert + "\n" + END_CERTIFICATE;
      }
      catch (final CertificateEncodingException ex)
      {
        throw new IllegalArgumentException ("Failed to encode certificate " + aCert, ex);
      }
    }
docs: Get the provided certificate as PEM (Base64) encoded String.
  
  @param aCert
  The certificate to encode. May not be <code>null</code>.
  @return The PEM string with {@link #BEGIN_CERTIFICATE} and
  {@link #END_CERTIFICATE}.
  @throws IllegalArgumentException
  If the certificate could not be encoded. Cause is a
  {@link CertificateEncodingException}.
  @since 8.5.5