/// <summary>
        /// Construct KERB_VERIFY_PAC_REQUEST structure
        /// </summary>
        /// <param name="serverSignature">
        /// PAC_SIGNATURE_DATA Signature value ([MS-PAC] section 2.8) 
        /// for the Server Signature ([MS-PAC] section 2.8.1)
        /// </param>
        /// <param name="kdcSignature">
        /// PAC_SIGNATURE_DATA SignatureType value ([MS-PAC] section 2.8)
        /// for the Key Distribution Center (KDC) Signature ([MS-PAC] section 2.8.1)
        /// </param>
        /// <returns>KERB_VERIFY_PAC_REQUEST structure</returns>        
        public static KERB_VERIFY_PAC_REQUEST CreateKerbVerifyPacRequest(
            PAC_SIGNATURE_DATA serverSignature,
            PAC_SIGNATURE_DATA kdcSignature)
        {
            KERB_VERIFY_PAC_REQUEST kerbVerifyPacRequest = new KERB_VERIFY_PAC_REQUEST();

            // ChecksumAndSignature (variable): The PAC_SIGNATURE_DATA Signature value
            // ([MS-PAC] section 2.8) for the Server Signature ([MS-PAC] section 2.8.1) in the PAC.
            // It MUST be followed by the PAC_SIGNATURE_DATA Signature value ([MS-PAC] section 2.8)
            // for the KDC Signature ([MS-PAC] section 2.8.1) in the PAC.
            int checksumAndSignatureLength = serverSignature.Signature.Length + kdcSignature.Signature.Length;
            byte[] checksumAndSignature = new byte[checksumAndSignatureLength];

            checksumAndSignature = ArrayUtility.ConcatenateArrays<byte>(
                  serverSignature.Signature,
                  kdcSignature.Signature);

            kerbVerifyPacRequest.MessageType = KERB_VERIFY_PAC_REQUEST_MessageType_Values.Default;
            kerbVerifyPacRequest.SignatureType = (uint)kdcSignature.SignatureType;
            kerbVerifyPacRequest.SignatureLength = (uint)kdcSignature.Signature.Length;
            kerbVerifyPacRequest.ChecksumLength = (uint)serverSignature.Signature.Length;
            kerbVerifyPacRequest.ChecksumAndSignature = checksumAndSignature;

            return kerbVerifyPacRequest;
        }
예제 #2
0
 /// <summary>
 /// Decode specified buffer from specified index, with specified count
 /// of bytes, into the instance of current class.
 /// </summary>
 /// <param name="buffer">The specified buffer.</param>
 /// <param name="index">The specified index from beginning of buffer.</param>
 /// <param name="count">The specified count of bytes to be decoded.</param>
 internal override void DecodeBuffer(byte[] buffer, int index, int count)
 {
     NativePacSignatureData =
         PacUtility.MemoryToObject <PAC_SIGNATURE_DATA>(buffer, index, count);
 }
 /// <summary>
 /// Decode specified buffer from specified index, with specified count
 /// of bytes, into the instance of current class.
 /// </summary>
 /// <param name="buffer">The specified buffer.</param>
 /// <param name="index">The specified index from beginning of buffer.</param>
 /// <param name="count">The specified count of bytes to be decoded.</param>
 internal override void DecodeBuffer(byte[] buffer, int index, int count)
 {
     NativePacSignatureData =
         PacUtility.MemoryToObject<PAC_SIGNATURE_DATA>(buffer, index, count);
 }