Exemple #1
0
        static ProtectedPasswordStorage RequestSecret(HMACKeyInfo keyInfo)
        {
            if (keyInfo.KeyType == HMACKeyInfo.HMACKeyType.SrkSecret)
            {
                ProtectedPasswordStorage secret = new ProtectedPasswordStorage();
                secret.WellKnown();
                return(secret);
            }

            return(ConsoleUtils.ReadPassword(String.Format("Please enter Passwd for key {0}: ",
                                                           keyInfo.Parameters.GetValueOf <string>("identifier"))));
        }
Exemple #2
0
        static ProtectedPasswordStorage RequestSecret(HMACKeyInfo keyInfo)
        {
            if (keyInfo.KeyType == HMACKeyInfo.HMACKeyType.SrkSecret)
            {
                ProtectedPasswordStorage secret = new ProtectedPasswordStorage();
                secret.WellKnown();
                return(secret);
            }

            ProtectedPasswordStorage pws = new ProtectedPasswordStorage();

            pws.AppendPasswordChar('I');
            pws.AppendPasswordChar('A');
            pws.AppendPasswordChar('I');
            pws.AppendPasswordChar('K');

            return(pws);
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            // Establish Connections
            IDictionary <string, TPMSession> sessions =
                XMLConfiguration.EstablischConnection(base_path + "ClientConfigXml/UnixSocketDeviceLin.xml");

            // Create one keystore per opened session
            //foreach (TPMSession tpmSes in sessions.Values)
            //	tpmSes.Keystore = new InMemoryKeystore();

            TPMSession sessionToUse = sessions["local0"];

            //	sessionToUse.SetRequestSecretCallback(RequestSecret);

            ProtectedPasswordStorage pws = new ProtectedPasswordStorage();

            pws.WellKnown();

            sessionToUse.AdministrationClient.TakeOwnership(ConsoleUtils.ReadPassword("Owner Password: "******"PCRS = " + sessionToUse.CapabilityClient.GetPCRCount());
        }