Exemple #1
0
        /// <summary>
        /// Loads a cert file.
        /// </summary>
        /// <param name="cert"></param>
        /// <returns></returns>
        public static CertificateChain Load(Stream cert)
        {
            CertificateChain certificateChain = new CertificateChain();

            certificateChain.ParseCert(cert);
            return(certificateChain);
        }
Exemple #2
0
        /// <summary>
        /// Loads a cert file.
        /// </summary>
        /// <param name="certFile"></param>
        /// <returns></returns>
        public static CertificateChain Load(byte[] certFile)
        {
            CertificateChain certificateChain = new CertificateChain();
            MemoryStream     memoryStream     = new MemoryStream(certFile);

            try
            {
                certificateChain.ParseCert(memoryStream);
            }
            catch
            {
                memoryStream.Dispose();
                throw;
            }
            memoryStream.Dispose();
            return(certificateChain);
        }