Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / StrongNameSignatureInformation.cs / 1305376 / StrongNameSignatureInformation.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
using System;
using System.Diagnostics;
using System.Security.Cryptography;
namespace System.Security.Cryptography {
///
/// Details about a strong name signature
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class StrongNameSignatureInformation {
private SignatureVerificationResult m_verificationResult;
private AsymmetricAlgorithm m_publicKey;
// All strong name signatures use SHA1 as their hash algorithm
private static readonly string StrongNameHashAlgorithm =
CapiNative.GetAlgorithmName(CapiNative.AlgorithmId.Sha1);
internal StrongNameSignatureInformation(AsymmetricAlgorithm publicKey) {
Debug.Assert(publicKey != null, "publicKey != null");
m_verificationResult = SignatureVerificationResult.Valid;
m_publicKey = publicKey;
}
internal StrongNameSignatureInformation(SignatureVerificationResult error) {
Debug.Assert(error != SignatureVerificationResult.Valid, "error != SignatureVerificationResult.Valid");
m_verificationResult = error;
}
///
/// Hash algorithm used in calculating the strong name signature
///
public string HashAlgorithm {
get { return StrongNameHashAlgorithm; }
}
///
/// HRESULT version of the result code
///
public int HResult {
get { return CapiNative.HResultForVerificationResult(m_verificationResult); }
}
///
/// Is the strong name signature valid, or was there some form of error
///
public bool IsValid {
get { return m_verificationResult == SignatureVerificationResult.Valid; }
}
///
/// Public key used to create the signature
///
public AsymmetricAlgorithm PublicKey {
get { return m_publicKey; }
}
///
/// Results of verifying the strong name signature
///
public SignatureVerificationResult VerificationResult {
get { return m_verificationResult; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
using System;
using System.Diagnostics;
using System.Security.Cryptography;
namespace System.Security.Cryptography {
///
/// Details about a strong name signature
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class StrongNameSignatureInformation {
private SignatureVerificationResult m_verificationResult;
private AsymmetricAlgorithm m_publicKey;
// All strong name signatures use SHA1 as their hash algorithm
private static readonly string StrongNameHashAlgorithm =
CapiNative.GetAlgorithmName(CapiNative.AlgorithmId.Sha1);
internal StrongNameSignatureInformation(AsymmetricAlgorithm publicKey) {
Debug.Assert(publicKey != null, "publicKey != null");
m_verificationResult = SignatureVerificationResult.Valid;
m_publicKey = publicKey;
}
internal StrongNameSignatureInformation(SignatureVerificationResult error) {
Debug.Assert(error != SignatureVerificationResult.Valid, "error != SignatureVerificationResult.Valid");
m_verificationResult = error;
}
///
/// Hash algorithm used in calculating the strong name signature
///
public string HashAlgorithm {
get { return StrongNameHashAlgorithm; }
}
///
/// HRESULT version of the result code
///
public int HResult {
get { return CapiNative.HResultForVerificationResult(m_verificationResult); }
}
///
/// Is the strong name signature valid, or was there some form of error
///
public bool IsValid {
get { return m_verificationResult == SignatureVerificationResult.Valid; }
}
///
/// Public key used to create the signature
///
public AsymmetricAlgorithm PublicKey {
get { return m_publicKey; }
}
///
/// Results of verifying the strong name signature
///
public SignatureVerificationResult VerificationResult {
get { return m_verificationResult; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeSnippetTypeMember.cs
- ContextMenuStrip.cs
- ApplicationManager.cs
- BaseDataBoundControl.cs
- MetafileHeader.cs
- UnsafeNativeMethods.cs
- PasswordBoxAutomationPeer.cs
- SafeRightsManagementSessionHandle.cs
- SocketElement.cs
- BuildProvider.cs
- Icon.cs
- CredentialSelector.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TimelineClockCollection.cs
- Model3D.cs
- InvalidCastException.cs
- XsltFunctions.cs
- InlineCategoriesDocument.cs
- Helpers.cs
- RegexReplacement.cs
- XmlSerializationWriter.cs
- JapaneseCalendar.cs
- ConfigurationElementCollection.cs
- NameTable.cs
- WebHttpBindingCollectionElement.cs
- ModelFactory.cs
- ToolStripItemCollection.cs
- Unit.cs
- DependencyObjectPropertyDescriptor.cs
- PatternMatcher.cs
- CodeSnippetCompileUnit.cs
- TextView.cs
- StrokeCollection.cs
- ClientConfigurationSystem.cs
- CroppedBitmap.cs
- RSAPKCS1SignatureFormatter.cs
- TimeManager.cs
- SoapAttributeAttribute.cs
- ComboBoxAutomationPeer.cs
- UIAgentAsyncEndRequest.cs
- SkinBuilder.cs
- ConditionalAttribute.cs
- TabItem.cs
- Vector.cs
- TextInfo.cs
- ChildrenQuery.cs
- HttpServerVarsCollection.cs
- DataBindingExpressionBuilder.cs
- EnvironmentPermission.cs
- DllHostInitializer.cs
- PropertyGridEditorPart.cs
- XmlSchemaObject.cs
- StrokeNodeOperations.cs
- LogArchiveSnapshot.cs
- AttachedPropertiesService.cs
- StreamUpgradeProvider.cs
- Parallel.cs
- uribuilder.cs
- ActivationWorker.cs
- Typeface.cs
- SpecialNameAttribute.cs
- PropertyValue.cs
- SeparatorAutomationPeer.cs
- NoClickablePointException.cs
- CodePageUtils.cs
- User.cs
- MILUtilities.cs
- ReservationCollection.cs
- HebrewCalendar.cs
- HttpGetServerProtocol.cs
- ErrorFormatterPage.cs
- TimelineClockCollection.cs
- WebPartHeaderCloseVerb.cs
- StringPropertyBuilder.cs
- TcpClientChannel.cs
- DataGridParentRows.cs
- Group.cs
- DirectionalLight.cs
- GradientSpreadMethodValidation.cs
- RawKeyboardInputReport.cs
- ColorAnimationBase.cs
- FlowDocumentPage.cs
- EntityDataSourceEntitySetNameItem.cs
- CachedPathData.cs
- sqlnorm.cs
- DataGridViewCellValueEventArgs.cs
- OleDbParameterCollection.cs
- milexports.cs
- SamlSecurityTokenAuthenticator.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- HTMLTextWriter.cs
- AmbientLight.cs
- GradientBrush.cs
- ModelPerspective.cs
- RoleManagerEventArgs.cs
- FontFamilyIdentifier.cs
- RequestQueue.cs
- EncodingDataItem.cs
- TextEvent.cs
- Point3DKeyFrameCollection.cs