static public void DumpLicenseValues(PlayReadyLicense license) { TestLogger.LogMessage(" "); TestLogger.LogMessage("License values:"); TestLogger.LogMessage("FullyEvaluated :" + license.FullyEvaluated.ToString()); TestLogger.LogMessage("UsableForPlay :" + license.UsableForPlay.ToString()); if (license.ExpirationDate == null) { TestLogger.LogMessage("Expiration date : Not specified"); } else { TestLogger.LogMessage("Expiration date :" + license.ExpirationDate.ToString()); } TestLogger.LogMessage("Expiration period after first play :" + license.ExpireAfterFirstPlay); TestLogger.LogMessage("DomainAccountId :" + license.DomainAccountID.ToString()); TestLogger.LogMessage("ChainDepth :" + license.ChainDepth); for (uint i = 0; i < license.ChainDepth; i++) { Guid keyId = license.GetKIDAtChainDepth(i); TestLogger.LogMessage(String.Format(System.Globalization.CultureInfo.CurrentCulture, "KeyId at chain depth ( {0} ) : {1}", i, keyId.ToString())); } TestLogger.LogMessage(" "); }
void VerifyLicenseShouldExist(Guid keyIdGuid, string strKeyIdString, bool bFullyEvaluated) { PlayReadyLicense license = LicenseManagement.FindSingleLicense(keyIdGuid, strKeyIdString, bFullyEvaluated); if (license == null) { TestLogger.LogMessage("License not found!!!"); TestActionFinished(false, null); } else { Guid keyIdFromLicense = license.GetKIDAtChainDepth(0); if (keyIdFromLicense == keyIdGuid || keyIdFromLicense == new Guid(System.Convert.FromBase64String(strKeyIdString))) { TestLogger.LogMessage("Matching license found in license store!!!"); TestActionFinished(true, null); } else { TestLogger.LogMessage("Matching license not found in license store!!!"); TestActionFinished(false, null); } } }