Encrypts using a specific certificate.
예제 #1
0
		/// <summary>
		/// Initializes a secured storage using certificate with specified thumbprint.
		/// </summary>
		public static void Initialize(string thumbprint)
		{
			var certificate = Find(thumbprint);

			if (certificate == null)
				throw new InvalidOperationException("Cannot find the required certificate.");

			if (!certificate.HasPrivateKey)
				throw new InvalidOperationException("The required certificate has no private key.");

			s_encryptor = new CertificateEncryptor(certificate);
		}
예제 #2
0
        /// <summary>
        /// Initializes a secured storage using certificate with specified thumbprint.
        /// </summary>
        public static void Initialize(string thumbprint)
        {
            var certificate = Find(thumbprint);

            if (certificate == null)
            {
                throw new InvalidOperationException("Cannot find the required certificate.");
            }

            if (!certificate.HasPrivateKey)
            {
                throw new InvalidOperationException("The required certificate has no private key.");
            }

            s_encryptor = new CertificateEncryptor(certificate);
        }