Ejemplo n.º 1
0
        // Implement the ISecurityPolicyEncodable interface.
        public void FromXml(SecurityElement et, PolicyLevel level)
        {
            if (et == null)
            {
                throw new ArgumentNullException("et");
            }
            if (et.Tag != "IMembershipCondition")
            {
                throw new ArgumentException(_("Security_PolicyName"));
            }
            if (et.Attribute("version") != "1")
            {
                throw new ArgumentException(_("Security_PolicyVersion"));
            }
            String value = et.Attribute("X509Certificate");

            certificate = new X509Certificate
                              (StrongNamePublicKeyBlob.FromHex(value));
        }
Ejemplo n.º 2
0
        // Implement the ISecurityPolicyEncodable interface.
        public void FromXml(SecurityElement et, PolicyLevel level)
        {
            if (et == null)
            {
                throw new ArgumentNullException("et");
            }
            if (et.Tag != "IMembershipCondition")
            {
                throw new ArgumentException(_("Security_PolicyName"));
            }
            if (et.Attribute("version") != "1")
            {
                throw new ArgumentException(_("Security_PolicyVersion"));
            }
            String val = et.Attribute("HashValue");

            value   = StrongNamePublicKeyBlob.FromHex(val);
            val     = et.Attribute("HashAlgorithm");
            hashAlg = HashAlgorithm.Create(val);
        }