Ejemplo n.º 1
0
        public XAdESSignedXml SetSignatureInfo()
        {
            // Set nodes identifiers
            this.Signature.Id  = XsdSchemas.FormatId("Signature");
            this.SignedInfo.Id = XsdSchemas.FormatId("Signature", "SignedInfo");

            return(this);
        }
Ejemplo n.º 2
0
        public static SignedPropertiesType CreateSignedProperties(this QualifyingPropertiesType qualifyingProperties
                                                                  , XAdESSignedXml signedXml)
        {
            qualifyingProperties.SignedProperties = new SignedPropertiesType
            {
                Id = XsdSchemas.FormatId(signedXml.Signature.Id, "SignedProperties")
            };

            return(qualifyingProperties.SignedProperties);
        }
Ejemplo n.º 3
0
        public Reference SetSignatureTransformReference()
        {
            Reference reference = new Reference(String.Empty);

            reference.Id = XsdSchemas.FormatId("Reference", "ID-");
            reference.AddTransform(new XmlDsigEnvelopedSignatureTransform());

            this.AddReference(reference);

            return(reference);
        }
Ejemplo n.º 4
0
        private XAdESSignedXml SetSignatureDataObject(QualifyingPropertiesType qualifyingProperties)
        {
            var document   = qualifyingProperties.ToXmlDocument();
            var nsMgr      = XsdSchemas.CreateXadesNamespaceManager(document);
            var dataObject = new DataObject();

            dataObject.Id   = XsdSchemas.FormatId(this.Signature.Id, "Object");
            dataObject.Data = document.DocumentElement.SelectNodes(".", nsMgr);

            this.AddObject(dataObject);

            return(this);
        }
Ejemplo n.º 5
0
        private XAdESSignedXml SetSignedPropertiesReference(SignedPropertiesType signedProperties)
        {
            var reference = new Reference
            {
                Id     = XsdSchemas.FormatId("SignedPropertiesID")
                , Uri  = String.Format("#{0}", signedProperties.Id)
                , Type = "http://uri.etsi.org/01903#SignedProperties"
            };

            this.AddReference(reference);

            return(this);
        }
Ejemplo n.º 6
0
        public XAdESSignedXml SetKeyInfo(X509Certificate certificate, RSA key)
        {
            this.KeyInfo    = new KeyInfo();
            this.KeyInfo.Id = XsdSchemas.FormatId("Certificate");

            this.KeyInfo.AddClause(new KeyInfoX509Data(certificate));
            this.KeyInfo.AddClause(new RSAKeyValue(key));

            this.AddReference(new Reference {
                Uri = String.Format("#{0}", this.KeyInfo.Id)
            });

            return(this);
        }