ホーム › Security.Authentication.Identity › SecPkgCred_SessionTicketKey
SecPkgCred_SessionTicketKey
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| TicketInfoVersion | DWORD | 4 | +0 | +0 | セッションチケット情報のバージョンを示す。 |
| KeyId | BYTE | 16 | +4 | +4 | セッションチケットキーの識別子バイト列。 |
| KeyingMaterial | BYTE | 64 | +20 | +20 | チケット暗号化に使う鍵素材のバイト列。 |
| KeyingMaterialSize | BYTE | 1 | +84 | +84 | 鍵素材のバイト数を示す。 |
各言語での定義
#include <windows.h>
// SecPkgCred_SessionTicketKey (x64 88 / x86 88 バイト)
typedef struct SecPkgCred_SessionTicketKey {
DWORD TicketInfoVersion;
BYTE KeyId[16];
BYTE KeyingMaterial[64];
BYTE KeyingMaterialSize;
} SecPkgCred_SessionTicketKey;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgCred_SessionTicketKey
{
public uint TicketInfoVersion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] KeyId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public byte[] KeyingMaterial;
public byte KeyingMaterialSize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgCred_SessionTicketKey
Public TicketInfoVersion As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public KeyId() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public KeyingMaterial() As Byte
Public KeyingMaterialSize As Byte
End Structureimport ctypes
from ctypes import wintypes
class SecPkgCred_SessionTicketKey(ctypes.Structure):
_fields_ = [
("TicketInfoVersion", wintypes.DWORD),
("KeyId", ctypes.c_ubyte * 16),
("KeyingMaterial", ctypes.c_ubyte * 64),
("KeyingMaterialSize", ctypes.c_ubyte),
]#[repr(C)]
pub struct SecPkgCred_SessionTicketKey {
pub TicketInfoVersion: u32,
pub KeyId: [u8; 16],
pub KeyingMaterial: [u8; 64],
pub KeyingMaterialSize: u8,
}import "golang.org/x/sys/windows"
type SecPkgCred_SessionTicketKey struct {
TicketInfoVersion uint32
KeyId [16]byte
KeyingMaterial [64]byte
KeyingMaterialSize byte
}type
SecPkgCred_SessionTicketKey = record
TicketInfoVersion: DWORD;
KeyId: array[0..15] of Byte;
KeyingMaterial: array[0..63] of Byte;
KeyingMaterialSize: Byte;
end;const SecPkgCred_SessionTicketKey = extern struct {
TicketInfoVersion: u32,
KeyId: [16]u8,
KeyingMaterial: [64]u8,
KeyingMaterialSize: u8,
};type
SecPkgCred_SessionTicketKey {.bycopy.} = object
TicketInfoVersion: uint32
KeyId: array[16, uint8]
KeyingMaterial: array[64, uint8]
KeyingMaterialSize: uint8struct SecPkgCred_SessionTicketKey
{
uint TicketInfoVersion;
ubyte[16] KeyId;
ubyte[64] KeyingMaterial;
ubyte KeyingMaterialSize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgCred_SessionTicketKey サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; TicketInfoVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; KeyId : BYTE (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; KeyingMaterial : BYTE (+20, 64byte) varptr(st)+20 を基点に操作(64byte:入れ子/配列)
; KeyingMaterialSize : BYTE (+84, 1byte) poke st,84,値 / 値 = peek(st,84)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgCred_SessionTicketKey
#field int TicketInfoVersion
#field byte KeyId 16
#field byte KeyingMaterial 64
#field byte KeyingMaterialSize
#endstruct
stdim st, SecPkgCred_SessionTicketKey ; NSTRUCT 変数を確保
st->TicketInfoVersion = 100
mes "TicketInfoVersion=" + st->TicketInfoVersion