コード例 #1
0
ファイル: ReportingService.cs プロジェクト: robert0825/Scutex
        public string GetAllLicenseActivations(string token)
        {
            GetAllLicenseActivationsResult result = new GetAllLicenseActivationsResult();

            try
            {
                if (!_controlService.ValidateManagementToken(token))
                {
                    result.WasOperationSuccessful = false;
                    result.WasRequestValid        = false;

                    return(_controlService.EncryptSymmetricResponse(_serializationProvider.Serialize(result)));
                }

                result.WasRequestValid    = true;
                result.LicenseActivations = _keyManagementService.GetAllLicenseActivations();

                result.WasOperationSuccessful = true;
            }
            catch (Exception ex)
            {
                result.WasException     = true;
                result.ExceptionMessage = ex.Message;                 // TODO: Must be modified to hide important data before release
            }

            return(_controlService.SerializeAndEncryptMgmtOutboundData(result));
        }
コード例 #2
0
        public GetAllLicenseActivationsResult GetAllServiceLicenseActivations(string url, string token, EncryptionInfo encryptionInfo, KeyPair serviceKeys)
        {
            ReportingServiceClient client = ReportingClientCreator(url);

            string encryptedToken = _symmetricEncryptionProvider.Encrypt(token, encryptionInfo);

            string encryptedResult = client.GetAllLicenseActivations(encryptedToken);
            string decryptedResult = _asymmetricEncryptionProvider.DecryptPublic(encryptedResult, serviceKeys);

            GetAllLicenseActivationsResult result = _objectSerializationProvider.Deserialize <GetAllLicenseActivationsResult>(decryptedResult);

            return(result);
        }
コード例 #3
0
        public List <LicenseActivation> GetAllServiceLicenseActivations(Service service)
        {
            string mgmtToken = _packingService.PackToken(service.GetManagementToken());

            GetAllLicenseActivationsResult result = _reportingProvider.GetAllServiceLicenseActivations(service.ManagementUrl, mgmtToken,
                                                                                                       GetManagementStandardEncryptionInfo(service),
                                                                                                       service.GetManagementServiceKeyPair());

            if (IsResultValid(result))
            {
                return(result.LicenseActivations);
            }

            return(new List <LicenseActivation>());
        }