ホーム › Security.Cryptography › OCSP_REQUEST_INFO
OCSP_REQUEST_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | OCSP要求のバージョン番号(通常はv1)。 |
| pRequestorName | CERT_ALT_NAME_ENTRY* | 8/4 | +8 | +4 | 要求者名を示す代替名エントリへのポインタ。NULL可。 |
| cRequestEntry | DWORD | 4 | +16 | +8 | rgRequestEntry配列の要素数。 |
| rgRequestEntry | OCSP_REQUEST_ENTRY* | 8/4 | +24 | +12 | 問い合わせ対象証明書ごとの要求エントリ配列へのポインタ。 |
| cExtension | DWORD | 4 | +32 | +16 | rgExtension配列の要素数。 |
| rgExtension | CERT_EXTENSION* | 8/4 | +40 | +20 | 要求全体に付随する証明書拡張の配列へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// OCSP_REQUEST_INFO (x64 48 / x86 24 バイト)
typedef struct OCSP_REQUEST_INFO {
DWORD dwVersion;
CERT_ALT_NAME_ENTRY* pRequestorName;
DWORD cRequestEntry;
OCSP_REQUEST_ENTRY* rgRequestEntry;
DWORD cExtension;
CERT_EXTENSION* rgExtension;
} OCSP_REQUEST_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OCSP_REQUEST_INFO
{
public uint dwVersion;
public IntPtr pRequestorName;
public uint cRequestEntry;
public IntPtr rgRequestEntry;
public uint cExtension;
public IntPtr rgExtension;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OCSP_REQUEST_INFO
Public dwVersion As UInteger
Public pRequestorName As IntPtr
Public cRequestEntry As UInteger
Public rgRequestEntry As IntPtr
Public cExtension As UInteger
Public rgExtension As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class OCSP_REQUEST_INFO(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("pRequestorName", ctypes.c_void_p),
("cRequestEntry", wintypes.DWORD),
("rgRequestEntry", ctypes.c_void_p),
("cExtension", wintypes.DWORD),
("rgExtension", ctypes.c_void_p),
]#[repr(C)]
pub struct OCSP_REQUEST_INFO {
pub dwVersion: u32,
pub pRequestorName: *mut core::ffi::c_void,
pub cRequestEntry: u32,
pub rgRequestEntry: *mut core::ffi::c_void,
pub cExtension: u32,
pub rgExtension: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type OCSP_REQUEST_INFO struct {
dwVersion uint32
pRequestorName uintptr
cRequestEntry uint32
rgRequestEntry uintptr
cExtension uint32
rgExtension uintptr
}type
OCSP_REQUEST_INFO = record
dwVersion: DWORD;
pRequestorName: Pointer;
cRequestEntry: DWORD;
rgRequestEntry: Pointer;
cExtension: DWORD;
rgExtension: Pointer;
end;const OCSP_REQUEST_INFO = extern struct {
dwVersion: u32,
pRequestorName: ?*anyopaque,
cRequestEntry: u32,
rgRequestEntry: ?*anyopaque,
cExtension: u32,
rgExtension: ?*anyopaque,
};type
OCSP_REQUEST_INFO {.bycopy.} = object
dwVersion: uint32
pRequestorName: pointer
cRequestEntry: uint32
rgRequestEntry: pointer
cExtension: uint32
rgExtension: pointerstruct OCSP_REQUEST_INFO
{
uint dwVersion;
void* pRequestorName;
uint cRequestEntry;
void* rgRequestEntry;
uint cExtension;
void* rgExtension;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OCSP_REQUEST_INFO サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pRequestorName : CERT_ALT_NAME_ENTRY* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; cRequestEntry : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; rgRequestEntry : OCSP_REQUEST_ENTRY* (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; cExtension : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; rgExtension : CERT_EXTENSION* (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OCSP_REQUEST_INFO サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pRequestorName : CERT_ALT_NAME_ENTRY* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; cRequestEntry : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; rgRequestEntry : OCSP_REQUEST_ENTRY* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; cExtension : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; rgExtension : CERT_EXTENSION* (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OCSP_REQUEST_INFO
#field int dwVersion
#field intptr pRequestorName
#field int cRequestEntry
#field intptr rgRequestEntry
#field int cExtension
#field intptr rgExtension
#endstruct
stdim st, OCSP_REQUEST_INFO ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion