private string Obtener_Certificado(byte[] pCertificado)
        {
            Cert loCert = new Cert();
            Rsa  loRsa  = new Rsa();

            bool success = true;

            // Desbloquea componente
            success = loRsa.UnlockComponent("RSAT34MB34N_7F1CD986683M");
            if (success != true)
            {
                throw new ArgumentException("No se pudo debloquear componente Chilkat RSA");
            }

            success = loCert.LoadFromBinary(pCertificado);

            if (success != true)
            {
                throw new ArgumentException("No se pudo cargar el archivo certificado");
            }

            string strCertificado = loCert.GetEncoded();
            int    LongitudCer    = strCertificado.Length;

            strCertificado = strCertificado.Substring(1 - 1, LongitudCer - 2);

            return(strCertificado);
        }
        private string Obtener_NoCertificado(byte[] pCertificado)
        {
            Cert loCert = new Cert();
            Rsa  loRsa  = new Rsa();

            bool success = true;

            // Desbloquea componente
            success = loRsa.UnlockComponent("RSAT34MB34N_7F1CD986683M");
            if (success != true)
            {
                throw new ArgumentException("No se pudo debloquear componente Chilkat RSA");
            }

            success = loCert.LoadFromBinary(pCertificado);

            if (success != true)
            {
                throw new ArgumentException("No se pudo cargar el archivo certificado");
            }

            string N = loCert.SerialNumber;

            string NoCertificado = N.Substring(02 - 1, 1) +
                                   N.Substring(04 - 1, 1) +
                                   N.Substring(06 - 1, 1) +
                                   N.Substring(08 - 1, 1) +
                                   N.Substring(10 - 1, 1) +
                                   N.Substring(12 - 1, 1) +
                                   N.Substring(14 - 1, 1) +
                                   N.Substring(16 - 1, 1) +
                                   N.Substring(18 - 1, 1) +
                                   N.Substring(20 - 1, 1) +
                                   N.Substring(22 - 1, 1) +
                                   N.Substring(24 - 1, 1) +
                                   N.Substring(26 - 1, 1) +
                                   N.Substring(28 - 1, 1) +
                                   N.Substring(30 - 1, 1) +
                                   N.Substring(32 - 1, 1) +
                                   N.Substring(34 - 1, 1) +
                                   N.Substring(36 - 1, 1) +
                                   N.Substring(38 - 1, 1) +
                                   N.Substring(40 - 1, 1);

            return(NoCertificado);
        }