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
- FillBehavior.cs
- Rect3DValueSerializer.cs
- XmlSchema.cs
- CodeNamespaceImport.cs
- CharKeyFrameCollection.cs
- SystemKeyConverter.cs
- PeerObject.cs
- ObjectQueryProvider.cs
- ConfigurationCollectionAttribute.cs
- DataRecordInternal.cs
- ReaderOutput.cs
- TagMapInfo.cs
- SubtreeProcessor.cs
- LingerOption.cs
- XmlDataProvider.cs
- SslStreamSecurityElement.cs
- MultiByteCodec.cs
- ValidationRuleCollection.cs
- DoubleAnimationClockResource.cs
- ConcurrentQueue.cs
- Bold.cs
- XamlTreeBuilderBamlRecordWriter.cs
- ContainerParagraph.cs
- PageClientProxyGenerator.cs
- BufferedStream.cs
- AssemblyName.cs
- CanonicalizationDriver.cs
- AttributeEmitter.cs
- HelpInfo.cs
- SynchronizedMessageSource.cs
- UnionQueryOperator.cs
- CaseStatementProjectedSlot.cs
- XmlLoader.cs
- RuleSettings.cs
- XmlWellformedWriter.cs
- FormViewPagerRow.cs
- XmlSchemaAttributeGroup.cs
- SafeNativeMethodsMilCoreApi.cs
- PrinterResolution.cs
- Classification.cs
- StreamMarshaler.cs
- ReadOnlyNameValueCollection.cs
- ObjectListShowCommandsEventArgs.cs
- Ipv6Element.cs
- GenericPrincipal.cs
- BehaviorEditorPart.cs
- Assert.cs
- ConfigXmlWhitespace.cs
- SrgsRuleRef.cs
- ExpressionCopier.cs
- PathGeometry.cs
- WebPartZoneBase.cs
- InteropBitmapSource.cs
- DataKeyArray.cs
- SpellCheck.cs
- DocumentXPathNavigator.cs
- RemotingException.cs
- SocketElement.cs
- EventManager.cs
- TransformerConfigurationWizardBase.cs
- SqlGatherProducedAliases.cs
- DeleteCardRequest.cs
- HtmlControl.cs
- AmbiguousMatchException.cs
- ManagedFilter.cs
- ClientRolePrincipal.cs
- Byte.cs
- IsolatedStorageFilePermission.cs
- Tokenizer.cs
- Journal.cs
- ListItemsPage.cs
- XPathNavigator.cs
- DataGridViewColumn.cs
- StreamInfo.cs
- WhitespaceRuleLookup.cs
- ScanQueryOperator.cs
- Normalization.cs
- DbProviderSpecificTypePropertyAttribute.cs
- httpapplicationstate.cs
- SymLanguageVendor.cs
- XmlSchemaAnnotated.cs
- RootBuilder.cs
- Triangle.cs
- UnsafeNativeMethodsCLR.cs
- MaterialGroup.cs
- DefaultHttpHandler.cs
- Automation.cs
- Types.cs
- HttpListenerContext.cs
- WebPageTraceListener.cs
- propertytag.cs
- OpenFileDialog.cs
- XmlSchemaValidationException.cs
- ReadOnlyNameValueCollection.cs
- PersonalizationProviderHelper.cs
- Polygon.cs
- BuildResult.cs
- Decorator.cs
- SqlGenericUtil.cs
- basemetadatamappingvisitor.cs