Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1305376 / 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 { [System.Security.SecurityCritical /*auto-generated*/] private SafeHashHandle _safeHashHandle = null; // // public constructors // [System.Security.SecuritySafeCritical] // auto-generated public SHA1CryptoServiceProvider() { // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides public transparent member protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override byte[] HashFinal() { return Utils.EndHash(_safeHashHandle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // SHA1CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class SHA1CryptoServiceProvider : SHA1 { [System.Security.SecurityCritical /*auto-generated*/] private SafeHashHandle _safeHashHandle = null; // // public constructors // [System.Security.SecuritySafeCritical] // auto-generated public SHA1CryptoServiceProvider() { // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides public transparent member protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // _CreateHash will check for failures and throw the appropriate exception _safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils.HashData(_safeHashHandle, rgb, ibStart, cbSize); } [System.Security.SecuritySafeCritical] // overrides protected transparent member protected override byte[] HashFinal() { return Utils.EndHash(_safeHashHandle); } } } // 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
- MediaContextNotificationWindow.cs
- CodeNamespaceImportCollection.cs
- ColumnCollection.cs
- MetadataArtifactLoaderCompositeFile.cs
- X500Name.cs
- UnicastIPAddressInformationCollection.cs
- HijriCalendar.cs
- BasicHttpMessageCredentialType.cs
- HttpListenerTimeoutManager.cs
- DataListItemCollection.cs
- Tokenizer.cs
- QueryExpr.cs
- TextBox.cs
- Propagator.cs
- DescriptionAttribute.cs
- WindowsGraphics2.cs
- EncryptedXml.cs
- TypeResolvingOptionsAttribute.cs
- WriteableBitmap.cs
- WebPartTransformerCollection.cs
- KeyInterop.cs
- Win32Native.cs
- PersonalizationState.cs
- WsatRegistrationHeader.cs
- HttpResponseHeader.cs
- CookielessData.cs
- SettingsPropertyCollection.cs
- TaiwanCalendar.cs
- SessionEndingCancelEventArgs.cs
- __Error.cs
- AbstractDataSvcMapFileLoader.cs
- Rectangle.cs
- Task.cs
- AutomationPatternInfo.cs
- RichTextBoxDesigner.cs
- Themes.cs
- ViewLoader.cs
- StringReader.cs
- HwndProxyElementProvider.cs
- PropertyInfoSet.cs
- ContentPosition.cs
- WindowsRichEdit.cs
- ObjectStateFormatter.cs
- HtmlUtf8RawTextWriter.cs
- FamilyMap.cs
- NaturalLanguageHyphenator.cs
- ResourcesChangeInfo.cs
- GeometryGroup.cs
- ProgramNode.cs
- TdsParserSessionPool.cs
- MetadataExchangeClient.cs
- WebBrowsableAttribute.cs
- DragCompletedEventArgs.cs
- PropertyCondition.cs
- XhtmlConformanceSection.cs
- ObjectDataProvider.cs
- ServiceObjectContainer.cs
- PolygonHotSpot.cs
- ActivityExecutorSurrogate.cs
- Converter.cs
- ComponentRenameEvent.cs
- _PooledStream.cs
- SqlTypeSystemProvider.cs
- ControlTemplate.cs
- DataSourceSelectArguments.cs
- CapabilitiesAssignment.cs
- AstNode.cs
- CaseInsensitiveHashCodeProvider.cs
- COM2Enum.cs
- HwndStylusInputProvider.cs
- SequenceQuery.cs
- EncodingNLS.cs
- DataKeyArray.cs
- SelectedGridItemChangedEvent.cs
- HtmlTable.cs
- UndoEngine.cs
- ComAwareEventInfo.cs
- NetCodeGroup.cs
- DataGridViewRow.cs
- BroadcastEventHelper.cs
- TextRunProperties.cs
- LocatorGroup.cs
- SystemIPInterfaceStatistics.cs
- WebRequest.cs
- DynamicValueConverter.cs
- QilInvokeEarlyBound.cs
- DbProviderSpecificTypePropertyAttribute.cs
- RankException.cs
- TextTreeRootTextBlock.cs
- _UncName.cs
- Main.cs
- _NestedMultipleAsyncResult.cs
- ProcessHostConfigUtils.cs
- SByte.cs
- DataListCommandEventArgs.cs
- PartialCachingAttribute.cs
- StateItem.cs
- XmlSchemaAttributeGroup.cs
- CodeTypeConstructor.cs
- IgnoreSection.cs