Пример #1
0
        /// <summary>
        /// Create a key pair for by using a given curve
        /// </summary>
        /// <param name="curveName">the curve to use for key creation</param>
        public void CreateKeyPair(string curveName)
        {
            var oid = Gost3410NamedParameters.GetOid(curveName);
            var keyGenerationParameters = new Gost3410KeyGenerationParameters(new SecureRandom(), oid);
            var keyGenerator            = new Gost3410KeyPairGenerator();

            keyGenerator.Init(keyGenerationParameters);
            keyPair = keyGenerator.GenerateKeyPair();
        }
Пример #2
0
        private static Gost3410Parameters LookupParameters(DerObjectIdentifier publicKeyParamSet)
        {
            if (publicKeyParamSet == null)
            {
                throw new ArgumentNullException("publicKeyParamSet");
            }
            Gost3410ParamSetParameters byOid = Gost3410NamedParameters.GetByOid(publicKeyParamSet);

            if (byOid == null)
            {
                throw new ArgumentException("OID is not a valid CryptoPro public key parameter set", "publicKeyParamSet");
            }
            return(new Gost3410Parameters(byOid.P, byOid.Q, byOid.A));
        }
Пример #3
0
        private static Gost3410Parameters LookupParameters(DerObjectIdentifier publicKeyParamSet)
        {
            //IL_0008: Unknown result type (might be due to invalid IL or missing references)
            //IL_0022: Unknown result type (might be due to invalid IL or missing references)
            if (publicKeyParamSet == null)
            {
                throw new ArgumentNullException("publicKeyParamSet");
            }
            Gost3410ParamSetParameters byOid = Gost3410NamedParameters.GetByOid(publicKeyParamSet);

            if (byOid == null)
            {
                throw new ArgumentException("OID is not a valid CryptoPro public key parameter set", "publicKeyParamSet");
            }
            return(new Gost3410Parameters(byOid.P, byOid.Q, byOid.A));
        }