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
- TextTreeText.cs
- ImagingCache.cs
- PartManifestEntry.cs
- OrCondition.cs
- ListViewGroupConverter.cs
- SizeAnimationUsingKeyFrames.cs
- CalendarTable.cs
- SafeLibraryHandle.cs
- XmlEnumAttribute.cs
- ZoneButton.cs
- PlatformNotSupportedException.cs
- TextTreeNode.cs
- DBNull.cs
- StringStorage.cs
- XamlPointCollectionSerializer.cs
- NTAccount.cs
- FormsIdentity.cs
- AssociationTypeEmitter.cs
- HandleCollector.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- PersistChildrenAttribute.cs
- ParameterInfo.cs
- ObjectSecurity.cs
- DiagnosticsConfigurationHandler.cs
- SemaphoreSecurity.cs
- HwndMouseInputProvider.cs
- HtmlEncodedRawTextWriter.cs
- PenThreadWorker.cs
- ResourceExpressionBuilder.cs
- GridViewSelectEventArgs.cs
- TextAutomationPeer.cs
- FlowLayoutPanel.cs
- AssemblyNameProxy.cs
- WebPartTransformer.cs
- TaskFileService.cs
- TypeBuilderInstantiation.cs
- ListViewContainer.cs
- PathStreamGeometryContext.cs
- TransformPattern.cs
- AppSettingsReader.cs
- XsltOutput.cs
- AuthenticationService.cs
- KeyInstance.cs
- OpCodes.cs
- HwndProxyElementProvider.cs
- WindowHelperService.cs
- FontStretchConverter.cs
- SspiNegotiationTokenProviderState.cs
- ListDependantCardsRequest.cs
- AVElementHelper.cs
- HybridObjectCache.cs
- DesignerVerbCollection.cs
- SponsorHelper.cs
- ContainerParaClient.cs
- PreviewPageInfo.cs
- WebExceptionStatus.cs
- TimeSpanParse.cs
- Tool.cs
- XmlTextReaderImpl.cs
- DataGridViewColumnConverter.cs
- ToolStripDropTargetManager.cs
- EpmHelper.cs
- FontInfo.cs
- WsdlInspector.cs
- List.cs
- Exceptions.cs
- Hashtable.cs
- SHA384Managed.cs
- BinaryObjectInfo.cs
- newinstructionaction.cs
- UITypeEditors.cs
- HttpHandlerActionCollection.cs
- Listbox.cs
- HwndTarget.cs
- CopyNodeSetAction.cs
- Environment.cs
- _ConnectOverlappedAsyncResult.cs
- ObjectViewListener.cs
- CatalogPartCollection.cs
- DoubleKeyFrameCollection.cs
- ReadOnlyPropertyMetadata.cs
- counter.cs
- ConstructorArgumentAttribute.cs
- InputElement.cs
- GatewayDefinition.cs
- MemoryStream.cs
- MulticastNotSupportedException.cs
- SmiContext.cs
- List.cs
- Condition.cs
- UriTemplateMatchException.cs
- Missing.cs
- XmlObjectSerializer.cs
- HostingEnvironment.cs
- SecurityPolicySection.cs
- Predicate.cs
- SqlBulkCopy.cs
- RepeaterItemEventArgs.cs
- ScrollChangedEventArgs.cs
- AutoResetEvent.cs