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
- RectangleHotSpot.cs
- ProfileManager.cs
- CompositeCollection.cs
- OdbcConnection.cs
- UnmanagedHandle.cs
- ColorConvertedBitmapExtension.cs
- LinearKeyFrames.cs
- MergeFailedEvent.cs
- XmlDataFileEditor.cs
- PointCollection.cs
- DragEventArgs.cs
- ServicesUtilities.cs
- VariableQuery.cs
- RoutingUtilities.cs
- SmtpReplyReader.cs
- XXXInfos.cs
- ValidationPropertyAttribute.cs
- PointCollectionConverter.cs
- CompositeScriptReferenceEventArgs.cs
- Material.cs
- LineServicesCallbacks.cs
- XmlMapping.cs
- HttpModuleActionCollection.cs
- NotConverter.cs
- HtmlWindowCollection.cs
- CapabilitiesState.cs
- AsymmetricKeyExchangeDeformatter.cs
- FontFamilyValueSerializer.cs
- DatePicker.cs
- CommonObjectSecurity.cs
- FlagPanel.cs
- FolderLevelBuildProviderCollection.cs
- cookie.cs
- CodeObject.cs
- BitVec.cs
- StrokeNodeOperations.cs
- RightsManagementPermission.cs
- SiteMapSection.cs
- PropertyMetadata.cs
- DbTransaction.cs
- SoapFault.cs
- COM2ExtendedUITypeEditor.cs
- UpDownBaseDesigner.cs
- ConfigPathUtility.cs
- ParameterCollection.cs
- StateMachineSubscriptionManager.cs
- EndPoint.cs
- CodeAccessPermission.cs
- Point.cs
- MSG.cs
- CallSiteHelpers.cs
- Options.cs
- ImageAttributes.cs
- ParseNumbers.cs
- ParsedAttributeCollection.cs
- PasswordTextNavigator.cs
- ExpressionBindingsDialog.cs
- FormViewPageEventArgs.cs
- AssemblyCacheEntry.cs
- TableItemPatternIdentifiers.cs
- _SSPIWrapper.cs
- SettingsPropertyIsReadOnlyException.cs
- XmlSignatureManifest.cs
- InstanceHandleConflictException.cs
- DebugInfoExpression.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SynchronizationLockException.cs
- MetadataItemSerializer.cs
- UInt32Converter.cs
- Parser.cs
- XmlSerializableServices.cs
- WebPartConnectionsDisconnectVerb.cs
- SoapCodeExporter.cs
- webeventbuffer.cs
- LayoutManager.cs
- CachingHintValidation.cs
- VectorValueSerializer.cs
- LocatorBase.cs
- LocalIdKeyIdentifierClause.cs
- ScriptingScriptResourceHandlerSection.cs
- recordstatescratchpad.cs
- LinkUtilities.cs
- WbemException.cs
- SourceItem.cs
- NumericUpDown.cs
- Attributes.cs
- CallSiteOps.cs
- ToolboxComponentsCreatedEventArgs.cs
- PrintPreviewControl.cs
- HeaderFilter.cs
- BitArray.cs
- CustomErrorsSection.cs
- DbRetry.cs
- TextDpi.cs
- EmptyEnumerable.cs
- ContentType.cs
- MembershipUser.cs
- Interlocked.cs
- AsyncCompletedEventArgs.cs
- LineMetrics.cs