Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Base / System / IO / Packaging / RightsManagementInformation.cs / 1 / RightsManagementInformation.cs
//------------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description:
// This class represents the rights-management information stored in an
// EncryptedPackageEnvelope. Specifically, it represents the PublishLicense and the
// UseLicenses stored in the compound file that embodies the RM protected Package.
//
// History:
// 06/06/2005: LGolding: Initial implementation.
//
//-----------------------------------------------------------------------------
using System.Collections.Generic;
using System.Security.RightsManagement;
using MS.Internal.IO.Packaging.CompoundFile;
namespace System.IO.Packaging
{
///
/// This class represents the rights-management information stored in an
/// EncryptedPackageEnvelope. Specifically, it represents the PublishLicense and the
/// UseLicenses stored in the compound file that embodies the RM protected Package.
///
public class RightsManagementInformation
{
///
/// Internal constructor, called by EncryptedPackageEnvelope.Create or EncryptedPackageEnvelope.Open.
///
internal
RightsManagementInformation(
RightsManagementEncryptionTransform rmet
)
{
_rmet = rmet;
}
///
/// This property represents the object that determines what operations the current
/// user is allowed to perform on the encrypted content.
///
public CryptoProvider CryptoProvider
{
get
{
return _rmet.CryptoProvider;
}
set
{
_rmet.CryptoProvider = value;
}
}
///
/// Read the publish license from the RM transform's primary instance data stream.
///
///
/// The publish license, or null if the compound file does not contain a publish
/// license (as it will not, for example, when the compound file is first created).
///
///
/// If the stream is corrupt, or if the RM instance data in this file cannot be
/// read by the current version of this class.
///
public PublishLicense LoadPublishLicense()
{
return _rmet.LoadPublishLicense();
}
///
/// Save the publish license to the RM transform's instance data stream.
///
///
/// The publish licence to be saved. The RM server returns a publish license as a string.
///
///
/// The stream is rewritten from the beginning, so any existing publish license is
/// overwritten.
///
///
/// If is null.
///
///
/// If the existing RM instance data in this file cannot be updated by the current version
/// of this class.
///
///
/// If the transform settings are fixed.
///
public void SavePublishLicense(PublishLicense publishLicense)
{
_rmet.SavePublishLicense(publishLicense);
}
///
/// Load a use license for the specified user from the RM transform's instance data
/// storage in the compound file.
///
///
/// The user whose use license is desired.
///
///
/// The use license for the specified user, or null if the compound file does not
/// contain a use license for the specified user.
///
///
/// If is null.
///
///
/// If the RM information in this file cannot be read by the current version of
/// this class.
///
public UseLicense LoadUseLicense(ContentUser userKey)
{
return _rmet.LoadUseLicense(userKey);
}
///
/// Save a use license for the specified user into the RM transform's instance data
/// storage in the compound file.
///
///
/// The user to whom the use license was issued.
///
///
/// The use license issued to that user.
///
///
/// Any existing use license for the specified user is removed from the compound
/// file before the new use license is saved.
///
///
/// If or is null.
///
///
/// If the RM information in this file cannot be written by the current version of
/// this class.
///
public void SaveUseLicense(ContentUser userKey, UseLicense useLicense)
{
_rmet.SaveUseLicense(userKey, useLicense);
}
///
/// Delete the use license for the specified user from the RM transform's instance
/// data storage in the compound file.
///
///
/// The user whose use license is to be deleted.
///
///
/// If is null.
///
///
/// If the RM information in this file cannot be updated by the current version of
/// this class.
///
public void DeleteUseLicense(ContentUser userKey)
{
_rmet.DeleteUseLicense(userKey);
}
///
/// This method retrieves a reference to a dictionary with keys of type User and values
/// of type UseLicense, containing one entry for each use license embedded in the compound
/// file for this particular transform instance. The collection is a snapshot of the use
/// licenses in the compound file at the time of the call. The term "Embedded" in the method
/// name emphasizes that the dictionary returned by this method only includes those use
/// licenses that are embedded in the compound file. It does not include any other use
/// licenses that the application might have acquired from an RM server but not yet embedded
/// into the compound file.
///
public IDictionary GetEmbeddedUseLicenses()
{
return _rmet.GetEmbeddedUseLicenses();
}
private RightsManagementEncryptionTransform _rmet;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description:
// This class represents the rights-management information stored in an
// EncryptedPackageEnvelope. Specifically, it represents the PublishLicense and the
// UseLicenses stored in the compound file that embodies the RM protected Package.
//
// History:
// 06/06/2005: LGolding: Initial implementation.
//
//-----------------------------------------------------------------------------
using System.Collections.Generic;
using System.Security.RightsManagement;
using MS.Internal.IO.Packaging.CompoundFile;
namespace System.IO.Packaging
{
///
/// This class represents the rights-management information stored in an
/// EncryptedPackageEnvelope. Specifically, it represents the PublishLicense and the
/// UseLicenses stored in the compound file that embodies the RM protected Package.
///
public class RightsManagementInformation
{
///
/// Internal constructor, called by EncryptedPackageEnvelope.Create or EncryptedPackageEnvelope.Open.
///
internal
RightsManagementInformation(
RightsManagementEncryptionTransform rmet
)
{
_rmet = rmet;
}
///
/// This property represents the object that determines what operations the current
/// user is allowed to perform on the encrypted content.
///
public CryptoProvider CryptoProvider
{
get
{
return _rmet.CryptoProvider;
}
set
{
_rmet.CryptoProvider = value;
}
}
///
/// Read the publish license from the RM transform's primary instance data stream.
///
///
/// The publish license, or null if the compound file does not contain a publish
/// license (as it will not, for example, when the compound file is first created).
///
///
/// If the stream is corrupt, or if the RM instance data in this file cannot be
/// read by the current version of this class.
///
public PublishLicense LoadPublishLicense()
{
return _rmet.LoadPublishLicense();
}
///
/// Save the publish license to the RM transform's instance data stream.
///
///
/// The publish licence to be saved. The RM server returns a publish license as a string.
///
///
/// The stream is rewritten from the beginning, so any existing publish license is
/// overwritten.
///
///
/// If is null.
///
///
/// If the existing RM instance data in this file cannot be updated by the current version
/// of this class.
///
///
/// If the transform settings are fixed.
///
public void SavePublishLicense(PublishLicense publishLicense)
{
_rmet.SavePublishLicense(publishLicense);
}
///
/// Load a use license for the specified user from the RM transform's instance data
/// storage in the compound file.
///
///
/// The user whose use license is desired.
///
///
/// The use license for the specified user, or null if the compound file does not
/// contain a use license for the specified user.
///
///
/// If is null.
///
///
/// If the RM information in this file cannot be read by the current version of
/// this class.
///
public UseLicense LoadUseLicense(ContentUser userKey)
{
return _rmet.LoadUseLicense(userKey);
}
///
/// Save a use license for the specified user into the RM transform's instance data
/// storage in the compound file.
///
///
/// The user to whom the use license was issued.
///
///
/// The use license issued to that user.
///
///
/// Any existing use license for the specified user is removed from the compound
/// file before the new use license is saved.
///
///
/// If or is null.
///
///
/// If the RM information in this file cannot be written by the current version of
/// this class.
///
public void SaveUseLicense(ContentUser userKey, UseLicense useLicense)
{
_rmet.SaveUseLicense(userKey, useLicense);
}
///
/// Delete the use license for the specified user from the RM transform's instance
/// data storage in the compound file.
///
///
/// The user whose use license is to be deleted.
///
///
/// If is null.
///
///
/// If the RM information in this file cannot be updated by the current version of
/// this class.
///
public void DeleteUseLicense(ContentUser userKey)
{
_rmet.DeleteUseLicense(userKey);
}
///
/// This method retrieves a reference to a dictionary with keys of type User and values
/// of type UseLicense, containing one entry for each use license embedded in the compound
/// file for this particular transform instance. The collection is a snapshot of the use
/// licenses in the compound file at the time of the call. The term "Embedded" in the method
/// name emphasizes that the dictionary returned by this method only includes those use
/// licenses that are embedded in the compound file. It does not include any other use
/// licenses that the application might have acquired from an RM server but not yet embedded
/// into the compound file.
///
public IDictionary GetEmbeddedUseLicenses()
{
return _rmet.GetEmbeddedUseLicenses();
}
private RightsManagementEncryptionTransform _rmet;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CollectionChangeEventArgs.cs
- TypeElementCollection.cs
- IsolatedStorageFilePermission.cs
- SynchronizationFilter.cs
- SqlClientWrapperSmiStream.cs
- ProviderConnectionPointCollection.cs
- RepeatInfo.cs
- StoryFragments.cs
- XPathAncestorQuery.cs
- Win32Native.cs
- OleDbInfoMessageEvent.cs
- EventEntry.cs
- CodeDomSerializer.cs
- TypefaceCollection.cs
- NativeRightsManagementAPIsStructures.cs
- CompositeCollection.cs
- BinarySecretKeyIdentifierClause.cs
- SymLanguageVendor.cs
- DropShadowEffect.cs
- BuildProviderAppliesToAttribute.cs
- TraceFilter.cs
- SqlServer2KCompatibilityAnnotation.cs
- MaskedTextBox.cs
- RangeBase.cs
- PartialCachingAttribute.cs
- TranslateTransform3D.cs
- NavigationService.cs
- DrawingContextDrawingContextWalker.cs
- _SslStream.cs
- XsdBuildProvider.cs
- FlowDocumentPaginator.cs
- MailAddress.cs
- WsdlBuildProvider.cs
- ParseChildrenAsPropertiesAttribute.cs
- SpnEndpointIdentity.cs
- Config.cs
- Glyph.cs
- SmiContextFactory.cs
- AutomationEventArgs.cs
- ResourcePool.cs
- AuthStoreRoleProvider.cs
- Persist.cs
- WS2007FederationHttpBinding.cs
- Point3D.cs
- CssTextWriter.cs
- ExpressionBuilderCollection.cs
- FactorySettingsElement.cs
- ToolboxDataAttribute.cs
- GridToolTip.cs
- ShaderRenderModeValidation.cs
- SmtpDigestAuthenticationModule.cs
- CompositeDuplexBindingElementImporter.cs
- AppSettingsSection.cs
- ClientCultureInfo.cs
- RepeaterItemEventArgs.cs
- ListParaClient.cs
- QilTargetType.cs
- SecurityDescriptor.cs
- HtmlShim.cs
- DrawTreeNodeEventArgs.cs
- WindowManager.cs
- SafeEventLogWriteHandle.cs
- DataGridHeaderBorder.cs
- ComplexBindingPropertiesAttribute.cs
- StringOutput.cs
- webproxy.cs
- FixedTextSelectionProcessor.cs
- WriteTimeStream.cs
- XsltException.cs
- CodeTypeReferenceExpression.cs
- CorrelationManager.cs
- RootAction.cs
- ComponentChangingEvent.cs
- GeneralTransform3DTo2DTo3D.cs
- Iis7Helper.cs
- DataGridClipboardHelper.cs
- XmlTypeMapping.cs
- FrameAutomationPeer.cs
- unsafenativemethodstextservices.cs
- GenericUriParser.cs
- DataGridViewComboBoxCell.cs
- ListDesigner.cs
- Point3DConverter.cs
- Helper.cs
- DefaultPrintController.cs
- MeasureData.cs
- SqlUserDefinedAggregateAttribute.cs
- WsatAdminException.cs
- MetafileEditor.cs
- TextReader.cs
- WebPartDisplayModeCollection.cs
- ExceptionDetail.cs
- CellQuery.cs
- DbConnectionInternal.cs
- HostedNamedPipeTransportManager.cs
- RequiredAttributeAttribute.cs
- Compiler.cs
- SimpleType.cs
- SessionEndedEventArgs.cs
- TimeSpan.cs