Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1 / SHA1CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // SHA1CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class SHA1CryptoServiceProvider : SHA1 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public SHA1CryptoServiceProvider() { SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripItemRenderEventArgs.cs
- InheritedPropertyChangedEventArgs.cs
- WS2007HttpBindingCollectionElement.cs
- BitmapData.cs
- PolicyValidationException.cs
- ServicesUtilities.cs
- storepermissionattribute.cs
- UrlMappingsSection.cs
- CompiledIdentityConstraint.cs
- SourceFilter.cs
- ConfigurationSection.cs
- CodeExpressionCollection.cs
- HMACSHA384.cs
- XmlDataSourceView.cs
- CompoundFileStorageReference.cs
- FontDialog.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- EllipticalNodeOperations.cs
- LocatorGroup.cs
- PropertyGeneratedEventArgs.cs
- DataSourceViewSchemaConverter.cs
- DeadCharTextComposition.cs
- NavigationProperty.cs
- CompilationLock.cs
- PropertyTab.cs
- OleDbParameterCollection.cs
- GroupBoxRenderer.cs
- SettingsPropertyValue.cs
- PolicyVersion.cs
- UInt16Converter.cs
- ConnectionManagementSection.cs
- ExpressionBuilder.cs
- UInt64Storage.cs
- UnsafeNativeMethodsMilCoreApi.cs
- BindingValueChangedEventArgs.cs
- Typeface.cs
- ExceptionHandlers.cs
- LexicalChunk.cs
- OperatorExpressions.cs
- GifBitmapEncoder.cs
- TextRange.cs
- WebScriptServiceHost.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Message.cs
- ProxyElement.cs
- InternalConfigRoot.cs
- SeparatorAutomationPeer.cs
- SoapIncludeAttribute.cs
- _ScatterGatherBuffers.cs
- Funcletizer.cs
- PeerMaintainer.cs
- MsmqReceiveHelper.cs
- XmlMtomWriter.cs
- GenericRootAutomationPeer.cs
- XXXOnTypeBuilderInstantiation.cs
- FontFamily.cs
- UnsafeMethods.cs
- ReferenceConverter.cs
- ValidatingPropertiesEventArgs.cs
- webclient.cs
- ContextMenuStripGroupCollection.cs
- Visual.cs
- ProcessModuleCollection.cs
- DocumentScope.cs
- ViewRendering.cs
- SafeNativeMethods.cs
- SoapFault.cs
- ExpressionBinding.cs
- ReadOnlyDataSourceView.cs
- TemplateXamlParser.cs
- HttpModuleCollection.cs
- GatewayDefinition.cs
- SoapAttributeAttribute.cs
- ProcessModelInfo.cs
- ProxySimple.cs
- SqlWorkflowInstanceStore.cs
- ActiveDocumentEvent.cs
- BindingBase.cs
- CssClassPropertyAttribute.cs
- Point4DValueSerializer.cs
- PersistenceMetadataNamespace.cs
- HttpApplication.cs
- RelationshipSet.cs
- XmlAnyElementAttributes.cs
- ModuleBuilderData.cs
- Funcletizer.cs
- DataServiceEntityAttribute.cs
- GregorianCalendarHelper.cs
- ListViewDeleteEventArgs.cs
- MarkupExtensionReturnTypeAttribute.cs
- MessageHeaderDescription.cs
- TextPenaltyModule.cs
- PropertyToken.cs
- FileSystemEventArgs.cs
- RoleGroup.cs
- TransformGroup.cs
- TextElementEnumerator.cs
- DiffuseMaterial.cs
- IisTraceWebEventProvider.cs
- XmlSerializationReader.cs