Inheritance: AsymmetricKeyParameter
コード例 #1
0
ファイル: DsaSigner.cs プロジェクト: ktw/OutlookPrivacyPlugin
		public void Init(
			bool				forSigning,
			ICipherParameters	parameters)
		{
			if (forSigning)
			{
				if (parameters is ParametersWithRandom)
				{
					ParametersWithRandom rParam = (ParametersWithRandom)parameters;

					this.random = rParam.Random;
					parameters = rParam.Parameters;
				}
				else
				{
					this.random = new SecureRandom();
				}

				if (!(parameters is DsaPrivateKeyParameters))
					throw new InvalidKeyException("DSA private key required for signing");

				this.key = (DsaPrivateKeyParameters) parameters;
			}
			else
			{
				if (!(parameters is DsaPublicKeyParameters))
					throw new InvalidKeyException("DSA public key required for verification");

				this.key = (DsaPublicKeyParameters) parameters;
			}
		}
コード例 #2
0
        public virtual void Init(bool forSigning, ICipherParameters	parameters)
        {
            SecureRandom providedRandom = null;

            if (forSigning)
            {
                if (parameters is ParametersWithRandom)
                {
                    ParametersWithRandom rParam = (ParametersWithRandom)parameters;

                    providedRandom = rParam.Random;
                    parameters = rParam.Parameters;
                }

                if (!(parameters is DsaPrivateKeyParameters))
                    throw new InvalidKeyException("DSA private key required for signing");

                this.key = (DsaPrivateKeyParameters)parameters;
            }
            else
            {
                if (!(parameters is DsaPublicKeyParameters))
                    throw new InvalidKeyException("DSA public key required for verification");

                this.key = (DsaPublicKeyParameters)parameters;
            }

            this.random = InitSecureRandom(forSigning && !kCalculator.IsDeterministic, providedRandom);
        }
コード例 #3
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            DsaKeyParameters dsaKeyParameters = obj as DsaKeyParameters;

            return(dsaKeyParameters != null && this.Equals(dsaKeyParameters));
        }
コード例 #4
0
		public override bool Equals(
			object obj)
		{
			if (obj == this)
				return true;

			DsaKeyParameters other = obj as DsaKeyParameters;

			if (other == null)
				return false;

			return Equals(other);
		}
コード例 #5
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            DsaKeyParameters other = obj as DsaKeyParameters;

            if (other == null)
            {
                return(false);
            }
            return(this.Equals(other));
        }
コード例 #6
0
 protected bool Equals(
     DsaKeyParameters other)
 {
     return(Platform.Equals(parameters, other.parameters) &&
            base.Equals(other));
 }
コード例 #7
0
		protected bool Equals(
			DsaKeyParameters other)
		{
			return Platform.Equals(parameters, other.parameters)
				&& base.Equals(other);
		}
コード例 #8
0
 protected bool Equals(DsaKeyParameters other) =>
 (object.Equals(this.parameters, other.parameters) && base.Equals((AsymmetricKeyParameter)other));
コード例 #9
0
 protected bool Equals(DsaKeyParameters other)
 {
     return(object.Equals(this.parameters, other.parameters) && base.Equals(other));
 }
コード例 #10
0
 protected bool Equals(
     DsaKeyParameters other)
 {
     return(Org.BouncyCastle.Utilities.Platform.Equals(parameters, other.parameters) &&
            base.Equals(other));
 }