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
- DeviceContext2.cs
- ToolStripPanelDesigner.cs
- DbProviderFactoriesConfigurationHandler.cs
- PopupEventArgs.cs
- Graphics.cs
- UpdateTranslator.cs
- GeneralTransformGroup.cs
- SecurityRuntime.cs
- InfocardChannelParameter.cs
- QuadraticBezierSegment.cs
- PathGradientBrush.cs
- CqlBlock.cs
- ToolboxBitmapAttribute.cs
- ValidationHelper.cs
- UserMapPath.cs
- _KerberosClient.cs
- DecoderReplacementFallback.cs
- DataKey.cs
- StringOutput.cs
- TemplateEditingFrame.cs
- InfoCardXmlSerializer.cs
- ExpressionConverter.cs
- SharedPersonalizationStateInfo.cs
- OSFeature.cs
- CodeArgumentReferenceExpression.cs
- XmlObjectSerializer.cs
- SaveFileDialogDesigner.cs
- ListViewHitTestInfo.cs
- VisualStyleInformation.cs
- DefaultIfEmptyQueryOperator.cs
- NamespaceMapping.cs
- ReplyChannelAcceptor.cs
- SqlDataRecord.cs
- CodeMethodMap.cs
- ProvidePropertyAttribute.cs
- WhitespaceRuleLookup.cs
- PageAsyncTask.cs
- ScaleTransform.cs
- RefreshEventArgs.cs
- DataList.cs
- ApplicationTrust.cs
- TabItemAutomationPeer.cs
- TypeSystem.cs
- ComboBoxItem.cs
- XmlSchemaAnyAttribute.cs
- AssemblyNameUtility.cs
- Region.cs
- ImageMapEventArgs.cs
- WindowsRichEdit.cs
- SqlParameter.cs
- JapaneseCalendar.cs
- ExpressionEvaluator.cs
- FixedPageAutomationPeer.cs
- ExpressionEditor.cs
- SafeCryptoHandles.cs
- TypeUtils.cs
- ButtonRenderer.cs
- AnnotationComponentManager.cs
- MsmqIntegrationSecurity.cs
- JulianCalendar.cs
- BinHexDecoder.cs
- File.cs
- XmlMapping.cs
- Bitmap.cs
- CaseKeyBox.ViewModel.cs
- OrCondition.cs
- FrameworkReadOnlyPropertyMetadata.cs
- TraceHandlerErrorFormatter.cs
- SortKey.cs
- GcHandle.cs
- HandlerFactoryCache.cs
- ReturnEventArgs.cs
- NestedContainer.cs
- SelectedGridItemChangedEvent.cs
- XmlDataLoader.cs
- HexParser.cs
- StringAnimationUsingKeyFrames.cs
- XmlCollation.cs
- NetStream.cs
- ElementAtQueryOperator.cs
- DoubleLinkList.cs
- PrintDialog.cs
- InkCanvasInnerCanvas.cs
- AutomationPeer.cs
- ObjectSecurity.cs
- DateTime.cs
- ReadOnlyObservableCollection.cs
- RoutedEventHandlerInfo.cs
- HwndTarget.cs
- LateBoundBitmapDecoder.cs
- PtsCache.cs
- InternalControlCollection.cs
- SiteMapNodeCollection.cs
- ForceCopyBuildProvider.cs
- EnumerableCollectionView.cs
- TypeBuilderInstantiation.cs
- FrameworkElement.cs
- DetailsViewPageEventArgs.cs
- Pair.cs
- HtmlEmptyTagControlBuilder.cs