ホーム › Security.Cryptography › SIGNER_CERT
SIGNER_CERT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位サイズ。呼び出し前に設定する。 |
| dwCertChoice | SIGNER_CERT_CHOICE | 4 | +4 | +4 | 証明書の指定方法(ストア/ファイル/BLOB等)を示す列挙値。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +8 | +8 | 選択方式に応じた証明書情報を保持する無名共用体。 |
| hwnd | HWND | 8/4 | +16 | +12 | ユーザーUI表示時の親ウィンドウハンドル。NULL可。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| pwszSpcFile | LPWSTR | 8/4 | +0 | +0 |
| pCertStoreInfo | SIGNER_CERT_STORE_INFO* | 8/4 | +0 | +0 |
| pSpcChainInfo | SIGNER_SPC_CHAIN_INFO* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// SIGNER_CERT (x64 24 / x86 16 バイト)
typedef struct SIGNER_CERT {
DWORD cbSize;
SIGNER_CERT_CHOICE dwCertChoice;
_Anonymous_e__Union Anonymous;
HWND hwnd;
} SIGNER_CERT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIGNER_CERT
{
public uint cbSize;
public uint dwCertChoice;
public _Anonymous_e__Union Anonymous;
public IntPtr hwnd;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIGNER_CERT
Public cbSize As UInteger
Public dwCertChoice As UInteger
Public Anonymous As _Anonymous_e__Union
Public hwnd As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SIGNER_CERT(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwCertChoice", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
("hwnd", ctypes.c_void_p),
]#[repr(C)]
pub struct SIGNER_CERT {
pub cbSize: u32,
pub dwCertChoice: u32,
pub Anonymous: _Anonymous_e__Union,
pub hwnd: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SIGNER_CERT struct {
cbSize uint32
dwCertChoice uint32
Anonymous _Anonymous_e__Union
hwnd uintptr
}type
SIGNER_CERT = record
cbSize: DWORD;
dwCertChoice: DWORD;
Anonymous: _Anonymous_e__Union;
hwnd: Pointer;
end;const SIGNER_CERT = extern struct {
cbSize: u32,
dwCertChoice: u32,
Anonymous: _Anonymous_e__Union,
hwnd: ?*anyopaque,
};type
SIGNER_CERT {.bycopy.} = object
cbSize: uint32
dwCertChoice: uint32
Anonymous: _Anonymous_e__Union
hwnd: pointerstruct SIGNER_CERT
{
uint cbSize;
uint dwCertChoice;
_Anonymous_e__Union Anonymous;
void* hwnd;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SIGNER_CERT サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwCertChoice : SIGNER_CERT_CHOICE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; hwnd : HWND (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SIGNER_CERT サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwCertChoice : SIGNER_CERT_CHOICE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; hwnd : HWND (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SIGNER_CERT
#field int cbSize
#field int dwCertChoice
#field byte Anonymous 8
#field intptr hwnd
#endstruct
stdim st, SIGNER_CERT ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。