/**
         * Retrieve an EC based domain parameter by parameter ID. A custom curve will be returned if one is available.
         *
         * @param paramID identifier for the domain parameters.
         * @return the matching domain parameters if found, null otherwise.
         */
        public static NamedECDomainParameters LookupDomainParameters(IECDomainParametersID paramID)
        {
            X9ECParameters rv = CustomNamedCurves.GetByName(paramID.CurveName);

            if (rv == null)
            {
                rv = ECNamedCurveTable.GetByName(paramID.CurveName);
            }

            if (rv != null)
            {
                return(new NamedECDomainParameters(ECNamedCurveTable.GetOid(paramID.CurveName), rv.Curve, rv.G, rv.N, rv.H, rv.GetSeed()));
            }

            return(null);
        }
Exemplo n.º 2
0
 internal AsymmetricECKey(Algorithm algorithm, IECDomainParametersID domainParameterID) : this(algorithm, ECDomainParametersIndex.LookupDomainParameters(domainParameterID))
 {
 }
Exemplo n.º 3
0
		public AsymmetricECPrivateKey(Algorithm ecAlg, IECDomainParametersID domainParametersID, BigInteger s, ECPoint w): base(ecAlg, domainParametersID)
		{
			this.d = s;
			this.publicKey = extractPublicKeyBytes(w);
			this.hashCode = calculateHashCode();
		}
Exemplo n.º 4
0
		public AsymmetricECPrivateKey(Algorithm ecAlg, IECDomainParametersID domainParametersID, BigInteger s): this(ecAlg, domainParametersID, s, null)
		{
		}
Exemplo n.º 5
0
 public AsymmetricECPublicKey(Algorithm ecAlg, IECDomainParametersID domainParameterID, ECPoint q) : base(ecAlg, domainParameterID)
 {
     this.q = KeyUtils.Validated(q);
 }
Exemplo n.º 6
0
 public AsymmetricECPublicKey(Algorithm ecAlg, IECDomainParametersID domainParameterID, byte[] encodedPoint) : base(ecAlg, domainParameterID)
 {
     this.q = KeyUtils.Validated(this.DomainParameters.Curve.DecodePoint(encodedPoint));
 }