code: public static X509Certificate newX509Certificate(final String type,
  		final byte[] certificateData) throws CertificateException
  	{
  		final CertificateFactory cf = CertificateFactory.getInstance(type);
  		final InputStream inputStream = new ByteArrayInputStream(certificateData);
  		final X509Certificate certificate = (X509Certificate)cf.generateCertificate(inputStream);
  		return certificate;
  	}
docs: Factory method for creating a new {@link X509Certificate} from the given certificate type and
  certificate data as byte array.
  
  
  @param type
  the certificate type
  @param certificateData
  the certificate data as byte array
  @return the new {@link X509Certificate}
  @throws CertificateException
  is thrown if no Provider supports a CertificateFactorySpi implementation for the
  given certificate type.