code: private PublicKey createPublicKey(String cert) {
          try {
              CertificateFactory fact = CertificateFactory.getInstance("X.509");
              InputStream stream = new ByteArrayInputStream(cert.getBytes(Charset.forName("UTF-8")));
              X509Certificate cer = (X509Certificate) fact.generateCertificate(stream);
              validateCertificate(cer);
              return cer.getPublicKey();
          } catch (SdkBaseException e) {
              throw e;
          } catch (Exception e) {
              throw new SdkClientException("Could not create public key from certificate", e);
          }
      }
docs: Build a PublicKey object from a cert
  
  @param cert The cert body
  @return A public key