ホーム › Security.Authentication.Identity › SecPkgCred_ClientCertPolicy
SecPkgCred_ClientCertPolicy
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | クライアント証明書ポリシーの動作を制御するフラグ。 |
| guidPolicyId | GUID | 16 | +4 | +4 | ポリシーを識別するGUID。 |
| dwCertFlags | DWORD | 4 | +20 | +20 | 証明書チェーン検証に渡すフラグを示す。 |
| dwUrlRetrievalTimeout | DWORD | 4 | +24 | +24 | 失効情報URL取得のタイムアウトをミリ秒で示す。0で既定値。 |
| fCheckRevocationFreshnessTime | BOOL | 4 | +28 | +28 | 失効情報の鮮度確認を行うか示すブール値。 |
| dwRevocationFreshnessTime | DWORD | 4 | +32 | +32 | 許容する失効情報の鮮度(経過時間)を示す。 |
| fOmitUsageCheck | BOOL | 4 | +36 | +36 | 証明書の用途チェックを省略するか示すブール値。 |
| pwszSslCtlStoreName | LPWSTR | 8/4 | +40 | +40 | SSL CTL(証明書信頼リスト)ストア名へのポインタ。NULL可。 |
| pwszSslCtlIdentifier | LPWSTR | 8/4 | +48 | +44 | SSL CTLの識別子文字列へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// SecPkgCred_ClientCertPolicy (x64 56 / x86 48 バイト)
typedef struct SecPkgCred_ClientCertPolicy {
DWORD dwFlags;
GUID guidPolicyId;
DWORD dwCertFlags;
DWORD dwUrlRetrievalTimeout;
BOOL fCheckRevocationFreshnessTime;
DWORD dwRevocationFreshnessTime;
BOOL fOmitUsageCheck;
LPWSTR pwszSslCtlStoreName;
LPWSTR pwszSslCtlIdentifier;
} SecPkgCred_ClientCertPolicy;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgCred_ClientCertPolicy
{
public uint dwFlags;
public Guid guidPolicyId;
public uint dwCertFlags;
public uint dwUrlRetrievalTimeout;
[MarshalAs(UnmanagedType.Bool)] public bool fCheckRevocationFreshnessTime;
public uint dwRevocationFreshnessTime;
[MarshalAs(UnmanagedType.Bool)] public bool fOmitUsageCheck;
public IntPtr pwszSslCtlStoreName;
public IntPtr pwszSslCtlIdentifier;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgCred_ClientCertPolicy
Public dwFlags As UInteger
Public guidPolicyId As Guid
Public dwCertFlags As UInteger
Public dwUrlRetrievalTimeout As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fCheckRevocationFreshnessTime As Boolean
Public dwRevocationFreshnessTime As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fOmitUsageCheck As Boolean
Public pwszSslCtlStoreName As IntPtr
Public pwszSslCtlIdentifier As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SecPkgCred_ClientCertPolicy(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("guidPolicyId", GUID),
("dwCertFlags", wintypes.DWORD),
("dwUrlRetrievalTimeout", wintypes.DWORD),
("fCheckRevocationFreshnessTime", wintypes.BOOL),
("dwRevocationFreshnessTime", wintypes.DWORD),
("fOmitUsageCheck", wintypes.BOOL),
("pwszSslCtlStoreName", ctypes.c_void_p),
("pwszSslCtlIdentifier", ctypes.c_void_p),
]#[repr(C)]
pub struct SecPkgCred_ClientCertPolicy {
pub dwFlags: u32,
pub guidPolicyId: GUID,
pub dwCertFlags: u32,
pub dwUrlRetrievalTimeout: u32,
pub fCheckRevocationFreshnessTime: i32,
pub dwRevocationFreshnessTime: u32,
pub fOmitUsageCheck: i32,
pub pwszSslCtlStoreName: *mut core::ffi::c_void,
pub pwszSslCtlIdentifier: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SecPkgCred_ClientCertPolicy struct {
dwFlags uint32
guidPolicyId windows.GUID
dwCertFlags uint32
dwUrlRetrievalTimeout uint32
fCheckRevocationFreshnessTime int32
dwRevocationFreshnessTime uint32
fOmitUsageCheck int32
pwszSslCtlStoreName uintptr
pwszSslCtlIdentifier uintptr
}type
SecPkgCred_ClientCertPolicy = record
dwFlags: DWORD;
guidPolicyId: TGUID;
dwCertFlags: DWORD;
dwUrlRetrievalTimeout: DWORD;
fCheckRevocationFreshnessTime: BOOL;
dwRevocationFreshnessTime: DWORD;
fOmitUsageCheck: BOOL;
pwszSslCtlStoreName: Pointer;
pwszSslCtlIdentifier: Pointer;
end;const SecPkgCred_ClientCertPolicy = extern struct {
dwFlags: u32,
guidPolicyId: GUID,
dwCertFlags: u32,
dwUrlRetrievalTimeout: u32,
fCheckRevocationFreshnessTime: i32,
dwRevocationFreshnessTime: u32,
fOmitUsageCheck: i32,
pwszSslCtlStoreName: ?*anyopaque,
pwszSslCtlIdentifier: ?*anyopaque,
};type
SecPkgCred_ClientCertPolicy {.bycopy.} = object
dwFlags: uint32
guidPolicyId: GUID
dwCertFlags: uint32
dwUrlRetrievalTimeout: uint32
fCheckRevocationFreshnessTime: int32
dwRevocationFreshnessTime: uint32
fOmitUsageCheck: int32
pwszSslCtlStoreName: pointer
pwszSslCtlIdentifier: pointerstruct SecPkgCred_ClientCertPolicy
{
uint dwFlags;
GUID guidPolicyId;
uint dwCertFlags;
uint dwUrlRetrievalTimeout;
int fCheckRevocationFreshnessTime;
uint dwRevocationFreshnessTime;
int fOmitUsageCheck;
void* pwszSslCtlStoreName;
void* pwszSslCtlIdentifier;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SecPkgCred_ClientCertPolicy サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; guidPolicyId : GUID (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwCertFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwUrlRetrievalTimeout : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; fCheckRevocationFreshnessTime : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwRevocationFreshnessTime : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fOmitUsageCheck : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pwszSslCtlStoreName : LPWSTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pwszSslCtlIdentifier : LPWSTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgCred_ClientCertPolicy サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; guidPolicyId : GUID (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwCertFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwUrlRetrievalTimeout : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; fCheckRevocationFreshnessTime : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwRevocationFreshnessTime : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fOmitUsageCheck : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pwszSslCtlStoreName : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pwszSslCtlIdentifier : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global SecPkgCred_ClientCertPolicy
#field int dwFlags
#field GUID guidPolicyId
#field int dwCertFlags
#field int dwUrlRetrievalTimeout
#field bool fCheckRevocationFreshnessTime
#field int dwRevocationFreshnessTime
#field bool fOmitUsageCheck
#field intptr pwszSslCtlStoreName
#field intptr pwszSslCtlIdentifier
#endstruct
stdim st, SecPkgCred_ClientCertPolicy ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags