According to what has been stated in the Introduction clause, an electronic signature produced in accordance with the present document incorporates: "a commitment that has been explicitly endorsed under a signature policy, at a given time, by a signer under an identifier, e.g. a name or a pseudonym, and optionally a role". While the name of the signer is important, the position of the signer within a company or an organization can be even more important. Some contracts may only be valid if signed by a user in a particular role, e.g. a Sales Director. In many cases who the sales Director really is, is not that important but being sure that the signer is empowered by his company to be the Sales Director is fundamental.
コード例 #1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public SignedSignatureProperties()
 {
     this.signingTime               = DateTime.MinValue;
     this.signingCertificate        = new SigningCertificate();
     this.signaturePolicyIdentifier = new SignaturePolicyIdentifier();
     this.signatureProductionPlace  = new SignatureProductionPlace();
     this.signerRole = new SignerRole();
 }
コード例 #2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public SignedSignatureProperties()
 {
     this.signingTime = DateTime.MinValue;
     this.signingCertificate = new SigningCertificate();
     this.signaturePolicyIdentifier = new SignaturePolicyIdentifier();
     this.signatureProductionPlace = new SignatureProductionPlace();
     this.signerRole = new SignerRole();
 }
コード例 #3
0
        /// <summary>
        /// Load state from an XML element
        /// </summary>
        /// <param name="xmlElement">XML element containing new state</param>
        public void LoadXml(System.Xml.XmlElement xmlElement)
        {
            XmlNamespaceManager xmlNamespaceManager;
            XmlNodeList         xmlNodeList;

            if (xmlElement == null)
            {
                throw new ArgumentNullException("xmlElement");
            }

            xmlNamespaceManager = new XmlNamespaceManager(xmlElement.OwnerDocument.NameTable);
            xmlNamespaceManager.AddNamespace("xsd", XadesSignedXml.XadesNamespaceUri);

            xmlNodeList = xmlElement.SelectNodes("xsd:SigningTime", xmlNamespaceManager);
            if (xmlNodeList.Count == 0)
            {
                throw new CryptographicException("SigningTime missing");
            }
            this.signingTime = XmlConvert.ToDateTime(xmlNodeList.Item(0).InnerText, XmlDateTimeSerializationMode.Utc);

            xmlNodeList = xmlElement.SelectNodes("xsd:SigningCertificate", xmlNamespaceManager);
            if (xmlNodeList.Count == 0)
            {
                throw new CryptographicException("SigningCertificate missing");
            }
            this.signingCertificate = new SigningCertificate();
            this.signingCertificate.LoadXml((XmlElement)xmlNodeList.Item(0));

            xmlNodeList = xmlElement.SelectNodes("xsd:SignaturePolicyIdentifier", xmlNamespaceManager);
            if (xmlNodeList.Count == 0)
            {
                throw new CryptographicException("SignaturePolicyIdentifier missing");
            }
            this.signaturePolicyIdentifier = new SignaturePolicyIdentifier();
            this.signaturePolicyIdentifier.LoadXml((XmlElement)xmlNodeList.Item(0));

            xmlNodeList = xmlElement.SelectNodes("xsd:SignatureProductionPlace", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.signatureProductionPlace = new SignatureProductionPlace();
                this.signatureProductionPlace.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            else
            {
                this.signatureProductionPlace = null;
            }

            xmlNodeList = xmlElement.SelectNodes("xsd:SignerRole", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.signerRole = new SignerRole();
                this.signerRole.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            else
            {
                this.signerRole = null;
            }
        }
コード例 #4
0
        /// <summary>
        /// Load state from an XML element
        /// </summary>
        /// <param name="xmlElement">XML element containing new state</param>
        public void LoadXml(System.Xml.XmlElement xmlElement)
        {
            XmlNamespaceManager xmlNamespaceManager;
            XmlNodeList xmlNodeList;

            if (xmlElement == null)
            {
                throw new ArgumentNullException("xmlElement");
            }

            xmlNamespaceManager = new XmlNamespaceManager(xmlElement.OwnerDocument.NameTable);
            xmlNamespaceManager.AddNamespace("xsd", XadesSignedXml.XadesNamespaceUri);

            xmlNodeList = xmlElement.SelectNodes("xsd:SigningTime", xmlNamespaceManager);
            if (xmlNodeList.Count == 0)
            {
                throw new CryptographicException("SigningTime missing");
            }
            this.signingTime = XmlConvert.ToDateTime(xmlNodeList.Item(0).InnerText, XmlDateTimeSerializationMode.Local);

            xmlNodeList = xmlElement.SelectNodes("xsd:SigningCertificate", xmlNamespaceManager);
            if (xmlNodeList.Count == 0)
            {
                throw new CryptographicException("SigningCertificate missing");
            }
            this.signingCertificate = new SigningCertificate();
            this.signingCertificate.LoadXml((XmlElement)xmlNodeList.Item(0));

            xmlNodeList = xmlElement.SelectNodes("xsd:SignaturePolicyIdentifier", xmlNamespaceManager);
            if (xmlNodeList.Count > 0)
            {
                this.signaturePolicyIdentifier = new SignaturePolicyIdentifier();
                this.signaturePolicyIdentifier.LoadXml((XmlElement)xmlNodeList.Item(0));
            }

            xmlNodeList = xmlElement.SelectNodes("xsd:SignatureProductionPlace", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.signatureProductionPlace = new SignatureProductionPlace();
                this.signatureProductionPlace.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            else
            {
                this.signatureProductionPlace = null;
            }

            xmlNodeList = xmlElement.SelectNodes("xsd:SignerRole", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.signerRole = new SignerRole();
                this.signerRole.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            else
            {
                this.signerRole = null;
            }
        }