SetKey() public abstract method

public abstract SetKey ( AsymmetricAlgorithm key ) : void
key AsymmetricAlgorithm
return void
        public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
        {
            AsymmetricSignatureDeformatter deformatter = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(this._strDeformatter);

            deformatter.SetKey(key);
            return(deformatter);
        }
        public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
        {
            AsymmetricSignatureDeformatter item = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(DeformatterAlgorithm);

            item.SetKey(key);
            item.SetHashAlgorithm("SHA1");
            return(item);
        }
        public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
        {
            AsymmetricSignatureDeformatter deformatter = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(base.DeformatterAlgorithm);

            deformatter.SetKey(key);
            deformatter.SetHashAlgorithm("SHA1");
            return(deformatter);
        }
示例#4
0
        /// <summary>Creates an <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" /> instance with the specified key using the <see cref="P:System.Security.Cryptography.SignatureDescription.DeformatterAlgorithm" /> property.</summary>
        /// <returns>The newly created <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" /> instance.</returns>
        /// <param name="key">The key to use in the <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" />. </param>
        public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
        {
            if (this._DeformatterAlgorithm == null)
            {
                throw new ArgumentNullException("DeformatterAlgorithm");
            }
            AsymmetricSignatureDeformatter asymmetricSignatureDeformatter = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(this._DeformatterAlgorithm);

            if (this._KeyAlgorithm == null)
            {
                throw new NullReferenceException("KeyAlgorithm");
            }
            asymmetricSignatureDeformatter.SetKey(key);
            return(asymmetricSignatureDeformatter);
        }
示例#5
0
        public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
        {
            if (_DeformatterAlgorithm == null)
            {
                throw new ArgumentNullException("DeformatterAlgorithm");
            }

            // this should throw the InvalidCastException if we have an invalid class
            // (but not if the class doesn't exist - as null is valid for AsymmetricSignatureDeformatter)
            AsymmetricSignatureDeformatter def = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(_DeformatterAlgorithm);

            if (_KeyAlgorithm == null)
            {
                throw new NullReferenceException("KeyAlgorithm");
            }

            def.SetKey(key);
            return(def);
        }