コード例 #1
0
        public override String ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("Hash - ");
            builder.Append(hashAlg.GetType().AssemblyQualifiedName);
            builder.Append(" = ");
            builder.Append(StrongNamePublicKeyBlob.ToHex(value));
            return(builder.ToString());
        }
コード例 #2
0
ファイル: Hash.cs プロジェクト: ForNeVeR/pnet
        // Convert this object into a string.
        public override String ToString()
        {
            SecurityElement element;

            element = new SecurityElement("System.Security.Policy.Hash");
            element.AddAttribute("version", "1");
            byte[] rawData = RawData;
            if (rawData != null && rawData.Length != 0)
            {
                element.AddChild(new SecurityElement
                                     ("RawData", StrongNamePublicKeyBlob.ToHex(rawData)));
            }
            return(element.ToString());
        }
コード例 #3
0
        public SecurityElement ToXml(PolicyLevel level)
        {
            SecurityElement element;

            element = new SecurityElement("IMembershipCondition");
            element.AddAttribute
                ("class",
                SecurityElement.Escape
                    (typeof(HashMembershipCondition).
                    AssemblyQualifiedName));
            element.AddAttribute("version", "1");
            element.AddAttribute
                ("HashValue", StrongNamePublicKeyBlob.ToHex(value));
            element.AddAttribute
                ("HashAlgorithm",
                SecurityElement.Escape(hashAlg.GetType().FullName));
            return(element);
        }