예제 #1
0
		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 override bool Equals(
            object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            DsaKeyParameters other = obj as DsaKeyParameters;

            if (other == null)
            {
                return(false);
            }

            return(Equals(other));
        }
예제 #3
0
 protected bool Equals(
     DsaKeyParameters other)
 {
     return(Platform.Equals(parameters, other.parameters) &&
            base.Equals(other));
 }
예제 #4
0
		protected bool Equals(
			DsaKeyParameters other)
		{
			return Platform.Equals(parameters, other.parameters)
				&& base.Equals(other);
		}