code: protected X509Certificate loadX509CertificateFromResource(String resource) throws CertificateException{
  		InputStream derInputStream = this.getClass().getClassLoader().getResourceAsStream(resource);
  		CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
  		X509Certificate cert = (X509Certificate) certificateFactory.generateCertificate(derInputStream);
  		try {
  			derInputStream.close();
  		} catch (IOException e) {
  			// ignore
  		}
  		return cert;
  	}
docs: Load X509 certificate from resources.
  Certificates can be in binary or base64 DER/.crt format.
  @param resource	the resource name
  @return	X509 certificate
  @throws CertificateException	if the certificate couldn't be loaded