예제 #1
0
        /// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SignatureDescription" /> class from the specified <see cref="T:System.Security.SecurityElement" />.</summary>
        /// <param name="el">The <see cref="T:System.Security.SecurityElement" /> from which to get the algorithms for the signature description. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="el" /> parameter is null.</exception>
        public SignatureDescription(SecurityElement el)
        {
            if (el == null)
            {
                throw new ArgumentNullException("el");
            }
            SecurityElement securityElement = el.SearchForChildByTag("Deformatter");

            this._DeformatterAlgorithm = ((securityElement != null) ? securityElement.Text : null);
            securityElement            = el.SearchForChildByTag("Digest");
            this._DigestAlgorithm      = ((securityElement != null) ? securityElement.Text : null);
            securityElement            = el.SearchForChildByTag("Formatter");
            this._FormatterAlgorithm   = ((securityElement != null) ? securityElement.Text : null);
            securityElement            = el.SearchForChildByTag("Key");
            this._KeyAlgorithm         = ((securityElement != null) ? securityElement.Text : null);
        }
예제 #2
0
        private byte[] GetNamedParam(SecurityElement se, string param)
        {
            SecurityElement sep = se.SearchForChildByTag(param);

            if (sep == null)
            {
                return(null);
            }
            return(Convert.FromBase64String(sep.Text));
        }
예제 #3
0
        /// LAMESPEC: ArgumentNullException is thrown (not CryptographicException)
        public SignatureDescription(SecurityElement el)
        {
            if (el == null)
            {
                throw new ArgumentNullException("el");
            }

            // thanksfully documented in VS.NET 2005
            SecurityElement child = el.SearchForChildByTag("Deformatter");

            _DeformatterAlgorithm = ((child == null) ? null : child.Text);

            child            = el.SearchForChildByTag("Digest");
            _DigestAlgorithm = ((child == null) ? null : child.Text);

            child = el.SearchForChildByTag("Formatter");
            _FormatterAlgorithm = ((child == null) ? null : child.Text);

            child         = el.SearchForChildByTag("Key");
            _KeyAlgorithm = ((child == null) ? null : child.Text);
        }