Esempio n. 1
0
        public static string sMachineKeyPathFile(tvProfile aoProfile, X509Certificate2 aoCertificate)
        {
            string lsMachineKeyPathFile = null;

            try
            {
                lsMachineKeyPathFile = Path.Combine(aoProfile.sValue("-MachineKeysPath", @"C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys")
                                                    , HashClass.GetKeyFileName(aoCertificate));
            }
            catch (InvalidOperationException ex)
            {
                if (aoProfile.bValue("-DeclareErrorOnPrivateKeyFileCleanedUp", false))
                {
                    Type ltDoGetCert = Type.GetType("DoGetCert");
                    if (null == ltDoGetCert)
                    {
                        throw ex;
                    }
                    else
                    {
                        ltDoGetCert.GetMethod("LogIt").Invoke(null, new object[] {
                            String.Format("GetCertServiceFault: {0}{1}{2}{3}"
                                          , ex.Message, (null == ex.InnerException ? "": "; " + ex.InnerException.Message)
                                          , Environment.NewLine
                                          , ex.StackTrace)
                        });
                    }
                }
            }

            return(lsMachineKeyPathFile);
        }
Esempio n. 2
0
        public static string sMachineKeyPathFile(tvProfile aoProfile, X509Certificate2 aoCertificate)
        {
            string lsMachineKeyPathFile = null;

            try
            {
                lsMachineKeyPathFile = Path.Combine(aoProfile.sValue("-MachineKeysPath", @"C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys")
                                                    , HashClass.GetKeyFileName(aoCertificate));
            }
            catch (InvalidOperationException ex)
            {
                if (aoProfile.bValue("-DeclareErrorOnPrivateKeyFileCleanedUp", false))
                {
                    DoGetCert.LogIt(aoProfile, DoGetCert.sExceptionMessage(ex));
                }
            }

            return(lsMachineKeyPathFile);
        }
Esempio n. 3
0
 public static string sHashIt(tvProfile aoProfile)
 {
     return(HashClass.sHashPw(aoProfile));
 }
Esempio n. 4
0
 public static string sHashIt(tvProfile aoProfile)
 {
     return(HashClass.sHashPw(aoProfile.ToString().Substring(0, 256)));
 }