public ECKeyGenerationParameters(
     DerObjectIdentifier publicKeyParamSet,
     SecureRandom random)
     : this(ECKeyParameters.LookupParameters(publicKeyParamSet), random)
 {
     this.publicKeyParamSet = publicKeyParamSet;
 }
		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 ECPrivateKeyParameters))
					throw new InvalidKeyException("EC private key required for signing");

				this.key = (ECPrivateKeyParameters) parameters;
			}
			else
			{
				if (!(parameters is ECPublicKeyParameters))
					throw new InvalidKeyException("EC public key required for verification");

				this.key = (ECPublicKeyParameters)parameters;
			}
		}
		protected bool Equals(
			ECKeyParameters other)
		{
			return parameters.Equals(other.parameters) && base.Equals(other);
		}
Example #4
0
 protected bool Equals(
     ECKeyParameters other)
 {
     return(parameters.Equals(other.parameters) && base.Equals(other));
 }