Org.BouncyCastle.Crypto.Parameters.ECDomainParameters.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(
            object obj)
        {
            if (obj == this)
                return true;

            ECDomainParameters other = obj as ECDomainParameters;

            if (other == null)
                return false;

            return Equals(other);
        }

Same methods

ECDomainParameters::Equals ( ECDomainParameters other ) : bool

Usage Example

Ejemplo n.º 1
0
        public MqvPrivateParameters(ECPrivateKeyParameters staticPrivateKey, ECPrivateKeyParameters ephemeralPrivateKey, ECPublicKeyParameters ephemeralPublicKey)
        {
            if (staticPrivateKey == null)
            {
                throw new ArgumentNullException("staticPrivateKey");
            }
            if (ephemeralPrivateKey == null)
            {
                throw new ArgumentNullException("ephemeralPrivateKey");
            }
            ECDomainParameters parameters = staticPrivateKey.Parameters;

            if (!parameters.Equals(ephemeralPrivateKey.Parameters))
            {
                throw new ArgumentException("Static and ephemeral private keys have different domain parameters");
            }
            if (ephemeralPublicKey == null)
            {
                ephemeralPublicKey = new ECPublicKeyParameters(parameters.G.Multiply(ephemeralPrivateKey.D), parameters);
            }
            else if (!parameters.Equals(ephemeralPublicKey.Parameters))
            {
                throw new ArgumentException("Ephemeral public key has different domain parameters");
            }
            this.staticPrivateKey    = staticPrivateKey;
            this.ephemeralPrivateKey = ephemeralPrivateKey;
            this.ephemeralPublicKey  = ephemeralPublicKey;
        }
All Usage Examples Of Org.BouncyCastle.Crypto.Parameters.ECDomainParameters::Equals