/// <summary>
        /// Grabs certificates from Ticket and Tmd.
        /// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
        /// </summary>
        /// <param name="tik"></param>
        /// <param name="tmd"></param>
        /// <returns></returns>
        public static CertificateChain FromTikTmd(Stream tik, Stream tmd)
        {
            CertificateChain c = new CertificateChain();

            c.grabFromTik(tik);
            c.grabFromTmd(tmd);
            return(c);
        }
        /// <summary>
        /// Grabs certificates from Ticket and Tmd.
        /// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
        /// </summary>
        /// <param name="tikFile"></param>
        /// <param name="tmdFile"></param>
        /// <returns></returns>
        public static CertificateChain FromTikTmd(byte[] tikFile, byte[] tmdFile)
        {
            CertificateChain c  = new CertificateChain();
            MemoryStream     ms = new MemoryStream(tikFile);

            try { c.grabFromTik(ms); }
            catch { ms.Dispose(); throw; }

            ms = new MemoryStream(tmdFile);

            try { c.grabFromTmd(ms); }
            catch { ms.Dispose(); throw; }

            ms.Dispose();

            if (!c.CertsComplete)
            {
                throw new Exception("Couldn't locate all certs!");
            }

            return(c);
        }
Example #3
0
        /// <summary>
        /// Grabs certificates from Ticket and Tmd.
        /// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
        /// </summary>
        /// <param name="tikFile"></param>
        /// <param name="tmdFile"></param>
        /// <returns></returns>
        public static CertificateChain FromTikTmd(byte[] tikFile, byte[] tmdFile)
        {
            CertificateChain c = new CertificateChain();
            MemoryStream ms = new MemoryStream(tikFile);

            try { c.grabFromTik(ms); }
            catch { ms.Dispose(); throw; }

            ms = new MemoryStream(tmdFile);

            try { c.grabFromTmd(ms); }
            catch { ms.Dispose(); throw; }

            ms.Dispose();

            if (!c.CertsComplete) throw new Exception("Couldn't locate all certs!");

            return c;
        }
Example #4
0
 /// <summary>
 /// Grabs certificates from Ticket and Tmd.
 /// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
 /// </summary>
 /// <param name="tik"></param>
 /// <param name="tmd"></param>
 /// <returns></returns>
 public static CertificateChain FromTikTmd(Stream tik, Stream tmd)
 {
     CertificateChain c = new CertificateChain();
     c.grabFromTik(tik);
     c.grabFromTmd(tmd);
     return c;
 }