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
- DbgUtil.cs
- List.cs
- AccessDataSource.cs
- DoubleLinkListEnumerator.cs
- WebPartRestoreVerb.cs
- TypeListConverter.cs
- PolyBezierSegment.cs
- ImageCodecInfoPrivate.cs
- EdmProviderManifest.cs
- ThemeInfoAttribute.cs
- WebPartCatalogAddVerb.cs
- Query.cs
- BinaryNode.cs
- ProcessHostConfigUtils.cs
- StringToken.cs
- CurrentChangedEventManager.cs
- ImageKeyConverter.cs
- FileLogRecordStream.cs
- MetadataSource.cs
- UrlAuthFailedErrorFormatter.cs
- CompensationDesigner.cs
- ReturnValue.cs
- TextRangeBase.cs
- ValueTypeFieldReference.cs
- RunClient.cs
- BindingManagerDataErrorEventArgs.cs
- WebBaseEventKeyComparer.cs
- LoginView.cs
- BuildResult.cs
- ElementUtil.cs
- CheckBoxAutomationPeer.cs
- XmlSignatureProperties.cs
- ZipArchive.cs
- VisualCollection.cs
- AttributeCollection.cs
- MsmqIntegrationValidationBehavior.cs
- ActiveXSite.cs
- UnionCodeGroup.cs
- DataAdapter.cs
- AssemblyName.cs
- SiteMembershipCondition.cs
- TreeView.cs
- HitTestFilterBehavior.cs
- AppearanceEditorPart.cs
- EventToken.cs
- ExceptionUtil.cs
- TextEditorMouse.cs
- ExtractCollection.cs
- ZoneButton.cs
- nulltextnavigator.cs
- ExceptionHelpers.cs
- _SafeNetHandles.cs
- CodeAccessSecurityEngine.cs
- LocalBuilder.cs
- SamlAudienceRestrictionCondition.cs
- EntityDataSourceWrapper.cs
- EncryptedType.cs
- MaterialCollection.cs
- OdbcHandle.cs
- MatrixCamera.cs
- SecUtil.cs
- Stylesheet.cs
- RemotingConfigParser.cs
- BindValidator.cs
- BooleanToVisibilityConverter.cs
- OperandQuery.cs
- FormViewRow.cs
- MessageQueueInstaller.cs
- Range.cs
- ProjectionCamera.cs
- QilUnary.cs
- DataSetViewSchema.cs
- SafeViewOfFileHandle.cs
- StylusButtonEventArgs.cs
- XPathDocumentIterator.cs
- ModulesEntry.cs
- HelpInfo.cs
- IncrementalReadDecoders.cs
- ColumnReorderedEventArgs.cs
- SecurityHeader.cs
- SystemInfo.cs
- DataGridViewCheckBoxCell.cs
- SqlDataSource.cs
- SqlExpressionNullability.cs
- TextRangeSerialization.cs
- ArrayConverter.cs
- SqlUserDefinedTypeAttribute.cs
- XmlSerializerVersionAttribute.cs
- Int32CollectionConverter.cs
- HtmlForm.cs
- ProfileSettings.cs
- TextTreeDeleteContentUndoUnit.cs
- ChangeBlockUndoRecord.cs
- SqlCacheDependencySection.cs
- TextBoxLine.cs
- FormViewInsertEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- TextTreeTextNode.cs
- Input.cs
- RadioButtonStandardAdapter.cs