Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › SecPkgContext_EapKeyBlock

SecPkgContext_EapKeyBlock

構造体
サイズx64: 192 バイト / x86: 192 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
rgbKeysBYTE128+0+0EAPで導出された鍵素材のバイト配列。
rgbIVsBYTE64+128+128EAPの初期化ベクタ(IV)のバイト配列。

各言語での定義

#include <windows.h>

// SecPkgContext_EapKeyBlock  (x64 192 / x86 192 バイト)
typedef struct SecPkgContext_EapKeyBlock {
    BYTE rgbKeys[128];
    BYTE rgbIVs[64];
} SecPkgContext_EapKeyBlock;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_EapKeyBlock
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] public byte[] rgbKeys;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public byte[] rgbIVs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_EapKeyBlock
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=128)> Public rgbKeys() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public rgbIVs() As Byte
End Structure
import ctypes
from ctypes import wintypes

class SecPkgContext_EapKeyBlock(ctypes.Structure):
    _fields_ = [
        ("rgbKeys", ctypes.c_ubyte * 128),
        ("rgbIVs", ctypes.c_ubyte * 64),
    ]
#[repr(C)]
pub struct SecPkgContext_EapKeyBlock {
    pub rgbKeys: [u8; 128],
    pub rgbIVs: [u8; 64],
}
import "golang.org/x/sys/windows"

type SecPkgContext_EapKeyBlock struct {
	rgbKeys [128]byte
	rgbIVs [64]byte
}
type
  SecPkgContext_EapKeyBlock = record
    rgbKeys: array[0..127] of Byte;
    rgbIVs: array[0..63] of Byte;
  end;
const SecPkgContext_EapKeyBlock = extern struct {
    rgbKeys: [128]u8,
    rgbIVs: [64]u8,
};
type
  SecPkgContext_EapKeyBlock {.bycopy.} = object
    rgbKeys: array[128, uint8]
    rgbIVs: array[64, uint8]
struct SecPkgContext_EapKeyBlock
{
    ubyte[128] rgbKeys;
    ubyte[64] rgbIVs;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgContext_EapKeyBlock サイズ: 192 バイト(x64)
dim st, 48    ; 4byte整数×48(構造体サイズ 192 / 4 切り上げ)
; rgbKeys : BYTE (+0, 128byte)  varptr(st)+0 を基点に操作(128byte:入れ子/配列)
; rgbIVs : BYTE (+128, 64byte)  varptr(st)+128 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgContext_EapKeyBlock
    #field byte rgbKeys 128
    #field byte rgbIVs 64
#endstruct

stdim st, SecPkgContext_EapKeyBlock        ; NSTRUCT 変数を確保