Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / SHA1CryptoServiceProvider.cs / 1 / 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 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public SHA1CryptoServiceProvider() { SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); // call the base class's Dispose base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_SHA1, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XdrBuilder.cs
- LicFileLicenseProvider.cs
- HitTestParameters.cs
- sqlcontext.cs
- WebConfigurationHostFileChange.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ResXResourceReader.cs
- XmlSchemaSimpleContentRestriction.cs
- ChildChangedEventArgs.cs
- ColorConverter.cs
- BindingMemberInfo.cs
- Error.cs
- DataTrigger.cs
- StorageAssociationSetMapping.cs
- Stylus.cs
- ProcessRequestArgs.cs
- NamespaceEmitter.cs
- SoapCodeExporter.cs
- JournalEntry.cs
- unsafenativemethodsother.cs
- SettingsContext.cs
- DataMemberListEditor.cs
- GridViewUpdateEventArgs.cs
- MD5Cng.cs
- QueryContext.cs
- Calendar.cs
- DesignerVerbCollection.cs
- DrawingCollection.cs
- CompositeDesignerAccessibleObject.cs
- ConstraintCollection.cs
- MenuItemBindingCollection.cs
- TableRowGroup.cs
- Identity.cs
- MethodAccessException.cs
- ModelItemDictionary.cs
- UIElement3D.cs
- TypeUtil.cs
- SafeHandles.cs
- PageAsyncTask.cs
- QueryCacheEntry.cs
- DocumentPageHost.cs
- GroupItem.cs
- HtmlTextArea.cs
- DecimalConverter.cs
- CompensableActivity.cs
- DictionaryKeyPropertyAttribute.cs
- ReachNamespaceInfo.cs
- ExpanderAutomationPeer.cs
- OdbcDataReader.cs
- StylusPointProperty.cs
- DataGridCell.cs
- Inflater.cs
- HttpConfigurationContext.cs
- List.cs
- Brush.cs
- WindowsAuthenticationEventArgs.cs
- DataPagerField.cs
- SemanticResolver.cs
- DefaultMemberAttribute.cs
- DataListCommandEventArgs.cs
- RelationshipEnd.cs
- BindableAttribute.cs
- FixedTextPointer.cs
- DocumentXPathNavigator.cs
- PackagingUtilities.cs
- AuthenticationModuleElement.cs
- Visual3D.cs
- SystemEvents.cs
- BStrWrapper.cs
- MailAddressCollection.cs
- IntSecurity.cs
- MembershipValidatePasswordEventArgs.cs
- MembershipValidatePasswordEventArgs.cs
- QuadraticBezierSegment.cs
- HttpAsyncResult.cs
- MarginsConverter.cs
- DataGridViewCellValidatingEventArgs.cs
- NetworkInformationPermission.cs
- EncodingTable.cs
- CheckBoxRenderer.cs
- Thickness.cs
- DocumentOrderQuery.cs
- URI.cs
- BitVector32.cs
- TileBrush.cs
- SafeNativeMethods.cs
- ActivitySurrogate.cs
- FixedDocumentPaginator.cs
- ManipulationDeltaEventArgs.cs
- WorkflowViewElement.cs
- XsdCachingReader.cs
- TableLayoutColumnStyleCollection.cs
- EdmScalarPropertyAttribute.cs
- DoubleAnimationUsingKeyFrames.cs
- WebPartUserCapability.cs
- RuleSet.cs
- HandoffBehavior.cs
- DoubleLink.cs
- ParserContext.cs
- UxThemeWrapper.cs