Exemple #1
0
        /// <summary>
        /// Creates a new set of keys
        /// </summary>
        /// <param name="PrivatePublic">True if private key should be included, false otherwise</param>
        /// <returns>XML representation of the key information</returns>
        public string CreateKey(bool PrivatePublic)
        {
            Contract.Requires <NullReferenceException>(AsymmetricAlgorithms != null, "AsymmetricAlgorithms");
            IAsymmetric Found = AsymmetricAlgorithms.FirstOrDefault();

            if (Found == null)
            {
                throw new ArgumentException("No asymmetric encryption algorithm found");
            }
            return(Found.CreateKey(PrivatePublic));
        }