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
- QuerySubExprEliminator.cs
- WebScriptMetadataMessageEncoderFactory.cs
- PersistenceParticipant.cs
- QilLiteral.cs
- XsdDateTime.cs
- ListItemParagraph.cs
- StringKeyFrameCollection.cs
- TypeConstant.cs
- MessageSecurityProtocol.cs
- TimeSpan.cs
- CodeDirectionExpression.cs
- GenericPrincipal.cs
- ScriptComponentDescriptor.cs
- BaseWebProxyFinder.cs
- ResourceExpressionBuilder.cs
- InstancePersistence.cs
- PrintPreviewGraphics.cs
- FlowDocumentReaderAutomationPeer.cs
- WebHttpSecurityModeHelper.cs
- HandlerWithFactory.cs
- Transform3D.cs
- FontStyle.cs
- SettingsPropertyIsReadOnlyException.cs
- NTAccount.cs
- DataGridViewLinkCell.cs
- UnknownMessageReceivedEventArgs.cs
- ResourceReferenceKeyNotFoundException.cs
- ClientConfigurationSystem.cs
- LoadedOrUnloadedOperation.cs
- QuarticEase.cs
- InputLanguageCollection.cs
- XmlSequenceWriter.cs
- ConcurrentDictionary.cs
- XsdSchemaFileEditor.cs
- GeometryGroup.cs
- DbgCompiler.cs
- JournalEntryStack.cs
- XmlSiteMapProvider.cs
- InternalConfigSettingsFactory.cs
- CharAnimationBase.cs
- FontWeightConverter.cs
- SafeLibraryHandle.cs
- JsonObjectDataContract.cs
- ColumnHeaderConverter.cs
- SemanticValue.cs
- XamlFigureLengthSerializer.cs
- FormatException.cs
- HttpContext.cs
- WebEventCodes.cs
- HtmlShim.cs
- ObjectDataSourceSelectingEventArgs.cs
- columnmapfactory.cs
- NetworkCredential.cs
- CompilationRelaxations.cs
- TextRenderingModeValidation.cs
- DialogResultConverter.cs
- RelatedEnd.cs
- UniqueIdentifierService.cs
- DelegatingChannelListener.cs
- SqlBulkCopyColumnMappingCollection.cs
- BrowserDefinitionCollection.cs
- DataViewListener.cs
- XmlSchemaComplexContentRestriction.cs
- XmlTextWriter.cs
- FontStretch.cs
- SessionPageStatePersister.cs
- XmlReaderDelegator.cs
- HandleCollector.cs
- ScriptRef.cs
- TextRangeEditLists.cs
- ContainerAction.cs
- SchemaImporterExtensionsSection.cs
- BitmapEffectInputConnector.cs
- ColorKeyFrameCollection.cs
- ReadOnlyMetadataCollection.cs
- CounterSampleCalculator.cs
- DropSource.cs
- PassportPrincipal.cs
- TableRowCollection.cs
- SimpleRecyclingCache.cs
- ZipIOLocalFileDataDescriptor.cs
- StyleReferenceConverter.cs
- HyperLinkField.cs
- SystemResourceKey.cs
- WebPermission.cs
- SrgsDocumentParser.cs
- DynamicActivity.cs
- ModelTreeEnumerator.cs
- ObjectCache.cs
- TextServicesLoader.cs
- LineInfo.cs
- MenuStrip.cs
- SystemWebSectionGroup.cs
- ListMarkerLine.cs
- CounterSampleCalculator.cs
- CodeComment.cs
- DateTimeParse.cs
- PageRanges.cs
- StringFunctions.cs
- StringCollectionMarkupSerializer.cs