MimeKit.Cryptography.DefaultSecureMimeContext.Import C# (CSharp) Method

Import() public method

Imports a DER-encoded certificate stream.
Imports all of the certificates in the DER-encoded stream.
/// is null. ///
public Import ( Stream stream, bool trusted ) : void
stream Stream The raw certificate(s).
trusted bool true if the certificates are trusted.
return void
		public void Import (Stream stream, bool trusted)
		{
			if (stream == null)
				throw new ArgumentNullException ("stream");

			var parser = new X509CertificateParser ();

			foreach (X509Certificate certificate in parser.ReadCertificates (stream)) {
				if (dbase.Find (certificate, X509CertificateRecordFields.Id) != null)
					continue;

				var record = new X509CertificateRecord (certificate);
				record.IsTrusted = trusted;
				dbase.Add (record);
			}
		}

Same methods

DefaultSecureMimeContext::Import ( Stream stream, string password ) : void
DefaultSecureMimeContext::Import ( X509Certificate certificate ) : void
DefaultSecureMimeContext::Import ( X509Crl crl ) : void