Esempio n. 1
0
        public PawnSecSetupForm(
            DataAccessTools dA,
            SecurityAccessor pSecAccess,
            StoreSetupVO sConfig,
            PawnSecVO pSecVo,
            EncryptedConfigContainer pEnc,
            string clientKey,
            string storeNum,
            bool initCreate)
        {
            InitializeComponent();
            this.logLevel      = LogLevel.DEBUG;
            this.storeNumber   = storeNum;
            GlobalChangesMade  = false;
            StoreChangesMade   = false;
            MachineChangesMade = false;
            initialCreation    = initCreate;
            this.storeData     = sConfig;
            pawnSecAccessor    = pSecAccess;
            pawnSecVo          = pSecVo;
            //CreatingWorkstation = false;
            this.dAPawnSec = dA;

            ResourceProperties resourceProperties = new ResourceProperties();

            resourceProperties.PrivateKey = clientKey;

            if (initCreate)
            {
                if (!pawnSecAccessor.InitializeSecurityData(resourceProperties, clientKey, storeNum, pSecVo,
                                                            out this.machineName,
                                                            out this.ipAddress,
                                                            out this.macAddress))
                {
                    throw new ApplicationException(
                              "Cannot initialize encryption portion of PAWNSEC™.");
                }
                this.pSec = pawnSecAccessor.EncryptConfig;
            }
            else
            {
                this.pSec = pEnc;
            }
        }
Esempio n. 2
0
 public SecureContainer(AceType aceType = AceType.FileSystem)
 {
     _sa = new SecurityAccessor(this, aceType);
     _sr = _sa.Descriptor.SecurityResults;
 }