RemoteCryptoSignHashRequest.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / RemoteCryptoSignHashRequest.cs / 1 / RemoteCryptoSignHashRequest.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards
{ 
    using System;
    using System.IO; 
 
    using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace;
 
    //
    // Summary:
    //  SignHash request for RpcCrypto
    // 
    internal class RemoteCryptoSignHashRequest : RpcCryptoRequest
    { 
        byte[]  m_signature; 
        byte[]  m_hash;
        int     m_hashType; 
        int     m_flags;

        //
        // Summary: 
        //  Creates an RpcCrypto SignHash request.
        // 
        // Arguments: 
        //  context:    The RpcCryptoContext used for this request
        //  hashType:   The type of hash 
        //  flags:      The CryptSignHash flags.
        //  hash:       The bytes of the hash value.
        //
        public RemoteCryptoSignHashRequest( 
                        RpcCryptoContext context,
                        int hashType, 
                        int flags, 
                        byte[] hash )
            : base( context ) 
        {
            m_hash = hash;
            m_hashType = hashType;
            m_flags = flags; 
        }
 
        // 
        // Summary:
        //  Gets the name of the request. 
        //
        public override string Name
        {
            get{ return "RpcCryptoSignHashRequest"; } 
        }
 
 

        // 
        // Summery:
        //  gets the signature buffer.
        //
        public byte[] GetSignature() 
        {
            return m_signature; 
        } 

        // 
        // Summary:
        //  Marshal the outbound arguments.
        //
        protected override void MarshalOutArgs( Stream stream ) 
        {
            BinaryWriter writer = new BinaryWriter( stream ); 
            writer.Write( m_hashType ); 
            writer.Write( m_flags );
            writer.Write( m_hash.Length ); 
            writer.Write( m_hash, 0, m_hash.Length );
        }

        // 
        // Summary:
        //  Marshal the return arguments. 
        // 
        protected override void MarshalReturnArgs( Stream stream )
        { 
            BinaryReader reader = new InfoCardBinaryReader( stream );
            m_signature = reader.ReadBytes( reader.ReadInt32() );
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK