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
- HtmlLiteralTextAdapter.cs
- DBDataPermission.cs
- InputLangChangeRequestEvent.cs
- Help.cs
- OrderPreservingPipeliningSpoolingTask.cs
- DbConnectionPoolGroupProviderInfo.cs
- ContextMenuStripGroupCollection.cs
- FrameworkElementFactoryMarkupObject.cs
- Expressions.cs
- PreloadHost.cs
- SetIterators.cs
- TextCompositionEventArgs.cs
- SqlConnectionPoolProviderInfo.cs
- TextEditorSelection.cs
- Flattener.cs
- StringFormat.cs
- ISFTagAndGuidCache.cs
- SettingsSection.cs
- FontFamilyIdentifier.cs
- TextChangedEventArgs.cs
- DisplayInformation.cs
- DataObject.cs
- OperationPerformanceCounters.cs
- XPathBinder.cs
- FixedSOMImage.cs
- TypeConverterHelper.cs
- GridViewUpdatedEventArgs.cs
- BamlCollectionHolder.cs
- SimpleBitVector32.cs
- NamespaceMapping.cs
- WebBrowserBase.cs
- Latin1Encoding.cs
- HtmlInputText.cs
- ArrayExtension.cs
- WindowsTooltip.cs
- Crc32.cs
- DiscoveryCallbackBehavior.cs
- SamlSecurityTokenAuthenticator.cs
- StringFreezingAttribute.cs
- EUCJPEncoding.cs
- FormClosingEvent.cs
- DataControlImageButton.cs
- SafeFindHandle.cs
- TraceEventCache.cs
- ExtractedStateEntry.cs
- MultilineStringConverter.cs
- ImageFormatConverter.cs
- CompiledXpathExpr.cs
- XpsSerializationManager.cs
- ColorAnimationUsingKeyFrames.cs
- Viewport3DVisual.cs
- PermissionAttributes.cs
- ServiceHost.cs
- WorkflowDefinitionDispenser.cs
- AccessControlList.cs
- NegotiateStream.cs
- UnsafeNativeMethods.cs
- XPathNavigatorReader.cs
- PrintPreviewGraphics.cs
- CodeTypeParameter.cs
- Inline.cs
- TagPrefixCollection.cs
- WebMethodAttribute.cs
- ProxyWebPartConnectionCollection.cs
- IPCCacheManager.cs
- FromRequest.cs
- DiagnosticTrace.cs
- BaseCollection.cs
- dataobject.cs
- WebPartZone.cs
- FragmentNavigationEventArgs.cs
- CryptoApi.cs
- MetadataArtifactLoaderCompositeFile.cs
- ColorConverter.cs
- DesignerAttribute.cs
- DispatcherSynchronizationContext.cs
- BindingContext.cs
- CustomWebEventKey.cs
- CodeVariableDeclarationStatement.cs
- _AcceptOverlappedAsyncResult.cs
- XsdCachingReader.cs
- X509PeerCertificateAuthenticationElement.cs
- MonitoringDescriptionAttribute.cs
- StringCollectionEditor.cs
- XmlSchemaElement.cs
- FileAuthorizationModule.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- externdll.cs
- ThicknessAnimation.cs
- CLRBindingWorker.cs
- _NestedSingleAsyncResult.cs
- XmlSerializationReader.cs
- SelectionUIService.cs
- FormViewInsertedEventArgs.cs
- ErrorHandlingAcceptor.cs
- MobileControlsSectionHelper.cs
- CutCopyPasteHelper.cs
- EncodingDataItem.cs
- ArgIterator.cs
- AnnotationMap.cs