Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / TrustUi / MS / Internal / documents / DigitalSignature.cs / 1 / DigitalSignature.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description:
// The DigitalSignature class represents a digital signature or signature
// request.
//
// History:
// 05/11/05 - [....] created
//
//---------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.IO.Packaging;
using System.Security; // for SecurityCritical attributes
using System.Windows.Xps.Packaging; // for XpsDigitalSignature
namespace MS.Internal.Documents
{
///
/// The DigitalSignature class represents a digital signature or signature
/// request.
///
internal sealed class DigitalSignature
{
#region Constructor
///
/// Critical
/// - We are marking this critical so that we are guaranteed that all
/// callers that construct an instance of this class are in a
/// trusted code path.
///
[SecurityCritical]
internal DigitalSignature()
{
}
#endregion Constructor
#region Internal properties
///
/// Gets or sets the status of signature (Valid, Invalid, NotSigned ...)
///
internal SignatureStatus SignatureState
{
get
{
return _signatureState.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_signatureState.Value = value;
}
}
///
/// Gets or sets the friendly name of the signer (obtained from the cert.
///
internal string SubjectName
{
get
{
return _subjectName.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_subjectName.Value = value;
}
}
///
/// Gets or sets the intent (from the Signature Definition)
///
internal string Reason
{
get
{
return _reason.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_reason.Value = value;
}
}
///
/// Gets or sets when this signature was applied (not a trusted time)
///
internal DateTime? SignedOn
{
get
{
return _signedOn.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_signedOn.Value = value;
}
}
///
/// Gets or sets the location field (what signer type into signature definition)
///
internal string Location
{
get
{
return _location.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_location.Value = value;
}
}
///
/// Gets or sets the restriction on document properties
///
internal bool IsDocumentPropertiesRestricted
{
get
{
return _isDocumentPropertiesRestricted.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_isDocumentPropertiesRestricted.Value = value;
}
}
///
/// Gets or sets whether adding signatures will invalidate this signature
///
internal bool IsAddingSignaturesRestricted
{
get
{
return _isAddingSignaturesRestricted.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_isAddingSignaturesRestricted.Value = value;
}
}
///
/// Gets or sets the Signature ID
///
internal Guid? GuidID
{
get
{
return _guidID.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_guidID.Value = value;
}
}
///
/// Gets or sets the X.509 Certificate
///
internal X509Certificate2 Certificate
{
get
{
return _x509Certificate2.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_x509Certificate2.Value = value;
}
}
///
/// Gets or sets the XpsDigitalSignature associated with this signature.
/// This value is expected to be left null for signature requests.
///
internal XpsDigitalSignature XpsDigitalSignature
{
get
{
return _xpsDigitalSignature.Value;
}
///
/// Critical
/// - Writing a critical for set piece of data
///
[SecurityCritical]
set
{
_xpsDigitalSignature.Value = value;
}
}
#endregion Internal properties
#region Private data
///
/// Status of signature (Valid, Invalid, NotSigned ...)
///
private SecurityCriticalDataForSet _signatureState;
///
/// Friendly name of the signer (obtained from the certificate)
///
private SecurityCriticalDataForSet _subjectName;
///
/// Intent: From the Signature Definition
///
private SecurityCriticalDataForSet _reason;
///
/// When this signature was applied (not a trusted time)
///
private SecurityCriticalDataForSet _signedOn;
///
/// Location field (what signer type into signature definition)
///
private SecurityCriticalDataForSet _location;
///
/// Whether or not document properties changes are restricted by this signature
///
private SecurityCriticalDataForSet _isDocumentPropertiesRestricted;
///
/// Whether or not adding signatures will invalidate this signature
///
private SecurityCriticalDataForSet _isAddingSignaturesRestricted;
///
/// SignatureID
///
private SecurityCriticalDataForSet _guidID;
private SecurityCriticalDataForSet _x509Certificate2;
///
/// The XpsDigitalSignature associated with this signature
///
private SecurityCriticalDataForSet _xpsDigitalSignature;
#endregion Private data
}
}
// 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
- ImageButton.cs
- _SSPIWrapper.cs
- CallbackHandler.cs
- DragDrop.cs
- SiteMapNodeCollection.cs
- formatter.cs
- BitFlagsGenerator.cs
- WebBrowserContainer.cs
- Queue.cs
- CategoryAttribute.cs
- CatchDesigner.xaml.cs
- TileBrush.cs
- TimeSpanValidator.cs
- XmlSchemaSimpleType.cs
- ComplexPropertyEntry.cs
- WsdlParser.cs
- IdleTimeoutMonitor.cs
- SafeBuffer.cs
- XmlToDatasetMap.cs
- EventSourceCreationData.cs
- BuiltInExpr.cs
- Lasso.cs
- DataContractSerializerOperationFormatter.cs
- AssemblyBuilder.cs
- webclient.cs
- NativeCompoundFileAPIs.cs
- Button.cs
- XmlSchemaExporter.cs
- EntityContainerAssociationSetEnd.cs
- DataGridViewTopRowAccessibleObject.cs
- WorkflowRuntime.cs
- MsmqBindingFilter.cs
- FormatConvertedBitmap.cs
- RepeaterItemCollection.cs
- ResourceReader.cs
- SpecularMaterial.cs
- HyperLinkStyle.cs
- ServicePointManager.cs
- BamlBinaryWriter.cs
- Journal.cs
- SignatureGenerator.cs
- FormsAuthenticationTicket.cs
- SetterBase.cs
- AccessText.cs
- HwndAppCommandInputProvider.cs
- Image.cs
- ContractTypeNameElement.cs
- DataGridViewTopLeftHeaderCell.cs
- SmiSettersStream.cs
- GridViewColumnHeader.cs
- CodeMemberEvent.cs
- documentsequencetextcontainer.cs
- ValueTable.cs
- RangeEnumerable.cs
- OutputCacheProfile.cs
- DBParameter.cs
- FilteredSchemaElementLookUpTable.cs
- TokenizerHelper.cs
- NotImplementedException.cs
- ScalarOps.cs
- SourceInterpreter.cs
- DbConnectionPoolIdentity.cs
- MatrixValueSerializer.cs
- ProxyWebPartConnectionCollection.cs
- Transactions.cs
- WindowsListBox.cs
- DataGridViewIntLinkedList.cs
- SmiXetterAccessMap.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- FileDialog_Vista_Interop.cs
- ChameleonKey.cs
- StyleSelector.cs
- SqlProfileProvider.cs
- CompoundFileIOPermission.cs
- DesignerForm.cs
- ColorConvertedBitmapExtension.cs
- ContextMenu.cs
- ImagingCache.cs
- GatewayIPAddressInformationCollection.cs
- AssociationEndMember.cs
- NavigationService.cs
- DependsOnAttribute.cs
- PackWebRequestFactory.cs
- TableLayoutRowStyleCollection.cs
- PagesChangedEventArgs.cs
- LowerCaseStringConverter.cs
- HttpCookieCollection.cs
- EntitySqlQueryState.cs
- LogExtentCollection.cs
- XmlQueryCardinality.cs
- XmlDataLoader.cs
- Keywords.cs
- SpellCheck.cs
- ITreeGenerator.cs
- ToolStripCodeDomSerializer.cs
- Object.cs
- HostedElements.cs
- HttpStaticObjectsCollectionBase.cs
- CapabilitiesPattern.cs
- Roles.cs