コード例 #1
0
 internal override byte[] EncodeBuffer()
 {
     using (SafeIntPtr ptr = TypeMarshal.ToIntPtr(NativeClaimsSetMetadata))
     {
         return(PacUtility.NdrMarshal(ptr, FormatString.OffsetClientClaim));
     }
 }
コード例 #2
0
 /// <summary>
 /// Encode the instance of current class into byte array,
 /// according to TD specification.
 /// </summary>
 /// <returns>The encoded byte array</returns>
 internal override byte[] EncodeBuffer()
 {
     using (SafeIntPtr ptr = TypeMarshal.ToIntPtr(NativeS4uDelegationInfo))
     {
         return(PacUtility.NdrMarshal(ptr, FormatString.OffsetS4u));
     }
 }
コード例 #3
0
        /// <summary>
        /// Encrypt a PacCredentialData instance. The encrypted data
        /// can be accessed from SerializedData property.
        /// </summary>
        /// <param name="credentialData">The _PAC_CREDENTIAL_DATA instance to be encrypted.</param>
        /// <param name="key">The encrypt key.</param>
        public void Encrypt(_PAC_CREDENTIAL_DATA credentialData, byte[] key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            byte[] plain = null;
            using (SafeIntPtr ptr = TypeMarshal.ToIntPtr(credentialData))
            {
                plain = PacUtility.NdrMarshal(ptr, FormatString.OffsetCredentialData);
            }
            NativePacCredentialInfo.SerializedData = Encrypt(key, plain, NativePacCredentialInfo.EncryptionType);
        }