internal IdeCancelamento() { Id = 0; Pedido = new PedidoCancelamento(); Signature = new DFeSignature(); DataHora = DateTime.Now; }
public TesteXml() { XmlItems = new List <IXmlItem>(); XmlProd = new DFeCollection <TesteXml4>(); TesteListEnum = new DFeCollection <TesteEnum>(); TesteDateTime = new DFeCollection <DateTime>(); Xml5 = new TesteXml5(); Signature = new DFeSignature(); }
/// <summary> /// Initializes a new instance of the <see cref="IdeRps"/> class. /// </summary> internal IdeRpsSubtituida() { NumeroRps = string.Empty; NumeroNfse = string.Empty; Serie = string.Empty; NFSeSubstituidora = string.Empty; Tipo = TipoRps.RPS; DataEmissaoNfseSubstituida = null; Signature = new DFeSignature(); }
/// <summary> /// Retornar o XML da assinatura ou nulo caso não tenha nada. /// </summary> /// <param name="signature">The signature.</param> /// <returns>XElement.</returns> protected XElement WriteSignature(DFeSignature signature) { if (signature.SignatureValue.IsEmpty() || signature.SignedInfo.Reference.DigestValue.IsEmpty() || signature.KeyInfo.X509Data.X509Certificate.IsEmpty()) { return(null); } var ms = new MemoryStream(); var serializer = DFeSerializer.CreateSerializer <DFeSignature>(); if (!serializer.Serialize(signature, ms)) { return(null); } return(XElement.Load(ms)); }
public NotaFiscal() { Id = 0; IdentificacaoRps = new IdeRps(); IdentificacaoNFSe = new IdeNFSe(); RpsSubstituido = new IdeRpsSubtituida(); Servico = new DadosServico(); Prestador = new DadosPrestador(); Tomador = new DadosTomador(); Intermediario = new DadosIntermediario(); ConstrucaoCivil = new DadosConstrucaoCivil(); Pagamento = new DadosPagamento(); OrgaoGerador = new IdeOrgaoGerador(); Signature = new DFeSignature(); Cancelamento = new IdeCancelamento(); Transportadora = new DadosTransportadora(); Emails = new EmailCollection(); }
/// <summary> /// Gera a assinatura do xml e retorna uma instancia da classe <see cref="DFeSignature" />. /// </summary> public static DFeSignature AssinarDocumento <TDocument>(this DFeSignDocument <TDocument> document, X509Certificate2 certificado, bool comments, SignDigest digest, SaveOptions options, out string signedXml) where TDocument : class { Guard.Against <ArgumentException>(!typeof(TDocument).HasAttribute <DFeSignInfoElement>(), "Atributo [DFeSignInfoElement] não encontrado."); var xml = document.GetXml(options, Encoding.UTF8); var xmlDoc = new XmlDocument { PreserveWhitespace = true }; xmlDoc.LoadXml(xml); var signatureInfo = typeof(TDocument).GetAttribute <DFeSignInfoElement>(); var xmlSignature = GerarAssinatura(xmlDoc, signatureInfo.SignElement, signatureInfo.SignAtribute, certificado, comments, digest); // Adiciona a assinatura no documento e retorna o xml assinado no parametro signedXml var element = xmlDoc.ImportNode(xmlSignature, true); xmlDoc.DocumentElement?.AppendChild(element); signedXml = xmlDoc.AsString(!options.HasFlag(SaveOptions.DisableFormatting), !options.HasFlag(SaveOptions.OmitDeclaration)); return(DFeSignature.Load(xmlSignature.OuterXml)); }
/// <summary> /// Initializes a new instance of the <see cref="NotaFiscal"/> class. /// </summary> public NotaFiscal(ConfiguracoesNFSe config, bool prestadorPadrão = true) { Guard.Against <ACBrException>(config == null, "Configurações não podem ser nulas"); this.config = config; Id = 0; IdentificacaoRps = new IdeRps(); IdentificacaoNFSe = new IdeNFSe(); RpsSubstituido = new IdeRpsSubtituida(); Servico = new DadosServico(); Prestador = prestadorPadrão ? config.PrestadorPadrao : new DadosPrestador(); Tomador = new DadosTomador(); Intermediario = new DadosIntermediario(); ConstrucaoCivil = new DadosConstrucaoCivil(); Pagamento = new DadosPagamento(); OrgaoGerador = new IdeOrgaoGerador(); Signature = new DFeSignature(); Cancelamento = new IdeCancelamento(); Transportadora = new DadosTransportadora(); Emails = new EmailCollection(); }
public NotaServico(ConfigNFSe config) { Guard.Against <ACBrDFeException>(config == null, "Configurações não podem ser nulas"); this.config = config; Id = 0; IdentificacaoRps = new IdeRps(); IdentificacaoNFSe = new IdeNFSe(); RpsSubstituido = new IdeRpsSubtituida(); Servico = new DadosServico(); EnderecoPrestacao = new Endereco(); Prestador = new DadosPrestador(); Tomador = new DadosTomador(); Intermediario = new DadosIntermediario(); ConstrucaoCivil = new DadosConstrucaoCivil(); Material = new DadosMateriais(); Pagamento = new DadosPagamento(); OrgaoGerador = new IdeOrgaoGerador(); Signature = new DFeSignature(); Cancelamento = new IdeCancelamento(); Transportadora = new DadosTransportadora(); Emails = new EmailCollection(); }
public NFeInutilizacaoResult() { InfInut = new NFeInfInut(); Signature = new DFeSignature(); }
/// <summary> /// Assina o xml. /// </summary> /// <param name="certificado">Certificado digital</param> /// <param name="options">Options.</param> /// <param name="comments">if set to <c>true</c> [comments].</param> /// <param name="digest">Digest.</param> protected void AssinarDocumento(X509Certificate2 certificado, SaveOptions options, bool comments, SignDigest digest) { Signature = SigningManager.AssinarDocumento(this, certificado, comments, digest, options, out var xml); Xml = xml; }
public CTeRetEventoCTe() { InfEvento = new CTeRetInfEvento(); Signature = new DFeSignature(); }
public NFeProtNFe() { Signature = new DFeSignature(); InfProt = new NFeInfProt(); }
public CTeRetCancCte() { InfCanc = new CTeInfCanc(); Signature = new DFeSignature(); }
public CTeEventoCTe() { InfEvento = new CTeInfEventoEnv(); Signature = new DFeSignature(); }
public NFeRetEvento() { InfEvento = new NFeRetInfEvento(); Signature = new DFeSignature(); }
public CTe() { Signature = new DFeSignature(); InfCTe = new CTeInfCTe(); }
public CTeProtCTe() { Signature = new DFeSignature(); InfProt = new CTeInfProt(); }
public NFe() { _infNFe = new infNFe(this); InfNFeSupl = new infNFeSupl(); Signature = new DFeSignature(); }
public InutilizaoServiceResult() { InfInut = new InfInutRet(); Signature = new DFeSignature(); }
internal PedidoCancelamento() { Id = 0; IdentificacaoNFSe = new IdeNFSe(); Signature = new DFeSignature(); }
/// <summary> /// Initializes a new instance of the <see cref="CFe" /> class. /// </summary> public CFeCanc() { InfCFe = new CancInfCFe(); Signature = new DFeSignature(); }
public CFe() { infCFe = new InfCFe(this); Signature = new DFeSignature(); }
public CTeInutCTe() { infInut = new CTeInfInutEnv(); Signature = new DFeSignature(); }