code: func (req *IdpAuthnRequest) MarshalAssertion() error {
  	buf, err := xml.Marshal(req.Assertion)
  	if err != nil {
  		return err
  	}
  
  	buf, err = xmlsec.Sign([]byte(req.IDP.Key),
  		buf, xmlsec.SignatureOptions{})
  	if err != nil {
  		return err
  	}
  
  	buf, err = xmlsec.Encrypt(getSPEncryptionCert(req.ServiceProviderMetadata),
  		buf, xmlsec.EncryptOptions{})
  	if err != nil {
  		return err
  	}
  
  	req.AssertionBuffer = buf
  	return nil
  }
docs: // MarshalAssertion sets `AssertionBuffer` to a signed, encrypted
  // version of `Assertion`.