code: func (b *Bundler) BundleFromPEMorDER(certsRaw, keyPEM []byte, flavor BundleFlavor, password string) (*Bundle, error) {
  	log.Debug("bundling from PEM files")
  	var key crypto.Signer
  	var err error
  	if len(keyPEM) != 0 {
  		key, err = helpers.ParsePrivateKeyPEM(keyPEM)
  		if err != nil {
  			log.Debugf("failed to parse private key: %v", err)
  			return nil, err
  		}
  	}
  
  	certs, err := helpers.ParseCertificatesPEM(certsRaw)
  	if err != nil {
  		// If PEM doesn't work try DER
  		var keyDER crypto.Signer
  		var errDER error
  		certs, keyDER, errDER = helpers.ParseCertificatesDER(certsRaw, password)
  		// Only use DER key if no key read from file
  		if key == nil && keyDER != nil {
  			key = keyDER
  		}
  		if errDER != nil {
  			log.Debugf("failed to parse certificates: %v", err)
  			// If neither parser works pass along PEM error
  			return nil, err
  		}
  
  	}
  	if len(certs) == 0 {
  		log.Debugf("no certificates found")
  		return nil, errors.New(errors.CertificateError, errors.DecodeFailed)
  	}
  
  	log.Debugf("bundle ready")
  	return b.Bundle(certs, key, flavor)
  }
docs: // BundleFromPEMorDER builds a certificate bundle from the set of byte
  // slices containing the PEM or DER-encoded certificate(s), private key.