code: public static X509CertificateHolder getX509CertificateHolder(CertifiedPublicKey cert)
      {
          if (cert instanceof BcX509CertifiedPublicKey) {
              return ((BcX509CertifiedPublicKey) cert).getX509CertificateHolder();
          } else {
              try {
                  return new X509CertificateHolder(cert.getEncoded());
              } catch (IOException e) {
                  // Very unlikely
                  throw new IllegalArgumentException("Invalid certified public key, unable to encode.");
              }
          }
  
      }
docs: Convert certified public key to certificate holder.
  
  @param cert the certified public key.
  @return a certificate holder.