code: protected X509CertifiedPublicKey getPublicKey(CertifiedPublicKey publicKey)
      {
          if (publicKey instanceof X509CertifiedPublicKey) {
              return (X509CertifiedPublicKey) publicKey;
          }
  
          throw new IllegalArgumentException(String.format("Unsupported certificate [%s], expecting X509 certificates.",
              publicKey.getClass().getName()));
      }
docs: Return the X.509 certificate.
  
  @param publicKey the certified public key.
  @return the cast to an X.509 certificate.
  @throws java.lang.IllegalArgumentException if the certified key is not an X.509 one.