Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / MD5Cng.cs / 1305376 / MD5Cng.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the BCrypt implementation of the MD5 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class MD5Cng : MD5 { private BCryptHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public MD5Cng() { Contract.Ensures(m_hashAlgorithm != null); if (CryptoConfig.AllowOnlyFipsAlgorithms) { throw new InvalidOperationException(SR.GetString(SR.Cryptography_NonCompliantFIPSAlgorithm)); } m_hashAlgorithm = new BCryptHashAlgorithm(CngAlgorithm.MD5, BCryptNative.ProviderName.MicrosoftPrimitiveProvider); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } //// // [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } //// // [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } //// // [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // 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
- DataGridViewTopRowAccessibleObject.cs
- XmlSchemaAttributeGroup.cs
- ToolStripDropDownItem.cs
- WhitespaceRuleLookup.cs
- ConfigsHelper.cs
- XmlSchemaRedefine.cs
- SamlConstants.cs
- GeneralTransform3D.cs
- _TransmitFileOverlappedAsyncResult.cs
- Task.cs
- MetafileHeader.cs
- updatecommandorderer.cs
- xsdvalidator.cs
- ComboBoxAutomationPeer.cs
- WindowsFormsHostPropertyMap.cs
- SendMailErrorEventArgs.cs
- Rotation3DAnimation.cs
- TagPrefixInfo.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- XmlDataDocument.cs
- OdbcEnvironmentHandle.cs
- latinshape.cs
- BindingMAnagerBase.cs
- DtdParser.cs
- FlowDocumentPaginator.cs
- WindowsFont.cs
- Frame.cs
- GroupLabel.cs
- XmlNamespaceMapping.cs
- DataColumn.cs
- FrugalList.cs
- PnrpPeerResolverElement.cs
- SQLInt64Storage.cs
- NavigationExpr.cs
- PasswordBox.cs
- X509SecurityToken.cs
- FontWeight.cs
- DeviceFiltersSection.cs
- FixedSOMTableCell.cs
- StylusDevice.cs
- WindowsAuthenticationEventArgs.cs
- StateMachineWorkflowInstance.cs
- DataGridColumn.cs
- DesignerUtils.cs
- RTLAwareMessageBox.cs
- NameTable.cs
- File.cs
- XmlEventCache.cs
- recordstatescratchpad.cs
- XsltException.cs
- ManifestResourceInfo.cs
- InputReferenceExpression.cs
- SystemFonts.cs
- QueryRewriter.cs
- ListViewItem.cs
- _HTTPDateParse.cs
- ValueHandle.cs
- MSHTMLHostUtil.cs
- PipeStream.cs
- OuterGlowBitmapEffect.cs
- PerspectiveCamera.cs
- SecUtil.cs
- wmiprovider.cs
- SQLChars.cs
- DocumentPageTextView.cs
- ActivityDesignerAccessibleObject.cs
- ExpressionPrefixAttribute.cs
- RoleService.cs
- IBuiltInEvidence.cs
- PrimaryKeyTypeConverter.cs
- EventsTab.cs
- EnvelopedPkcs7.cs
- RegistrationServices.cs
- XmlJsonWriter.cs
- CodeCommentStatement.cs
- XamlLoadErrorInfo.cs
- Ops.cs
- HuffmanTree.cs
- AssociatedControlConverter.cs
- IChannel.cs
- BamlBinaryWriter.cs
- ContactManager.cs
- HttpContextBase.cs
- PhysicalOps.cs
- MouseActionConverter.cs
- XpsFont.cs
- Label.cs
- TypeDelegator.cs
- ProcessThread.cs
- ConstraintEnumerator.cs
- XmlByteStreamReader.cs
- AssemblyInfo.cs
- EnvelopedSignatureTransform.cs
- StringOutput.cs
- StringResourceManager.cs
- ArrayItemValue.cs
- SpecialNameAttribute.cs
- HtmlTernaryTree.cs
- ReadWriteSpinLock.cs
- IList.cs