Exemplo n.º 1
0
        /// <summary>
        /// Returns the *.config file XML section representing this public key.
        /// </summary>
        public string ToConfigSection()
        {
            var sb = new StringBuilder();

            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyModulus, Modulus));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyExponent, Exponent));
            return(sb.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the *.config file XML section representing this private key.
        /// </summary>
        public string ToConfigSection()
        {
            var sb = new StringBuilder();

            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyModulus, Modulus));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyExponent, Exponent));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyPrimeP, PrimeP));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyPrimeQ, PrimeQ));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyPrimeExponentP, PrimeExponentP));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyPrimeExponentQ, PrimeExponentQ));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyCoefficient, Coefficient));
            sb.Append(KeyPairUtils.WriteConfigKey(KeyPairUtils.KeyPrivateExponent, PrivateExponent));
            return(sb.ToString());
        }