public ECKeyGenerationParameters(
     DerObjectIdentifier publicKeyParamSet,
     SecureRandom random)
     : this(ECKeyParameters.LookupParameters(publicKeyParamSet), random)
 {
     this.publicKeyParamSet = publicKeyParamSet;
 }
Ejemplo n.º 2
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 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;
			}
		}
Ejemplo n.º 3
0
		protected bool Equals(
			ECKeyParameters other)
		{
			return parameters.Equals(other.parameters) && base.Equals(other);
		}
Ejemplo n.º 4
0
 protected bool Equals(
     ECKeyParameters other)
 {
     return(parameters.Equals(other.parameters) && base.Equals(other));
 }