ホーム › Security.Cryptography › CRL_CONTEXT
CRL_CONTEXT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwCertEncodingType | CERT_QUERY_ENCODING_TYPE | 4 | +0 | +0 | CRLのエンコード種別(X509_ASN_ENCODING等)。 |
| pbCrlEncoded | BYTE* | 8/4 | +8 | +4 | エンコード済みCRLのバイト列へのポインタ。 |
| cbCrlEncoded | DWORD | 4 | +16 | +8 | pbCrlEncodedのサイズ(バイト単位)。 |
| pCrlInfo | CRL_INFO* | 8/4 | +24 | +12 | デコード済みのCRL情報(CRL_INFO)へのポインタ。 |
| hCertStore | HCERTSTORE | 8/4 | +32 | +16 | このCRLが属する証明書ストアのハンドル。NULL可。 |
各言語での定義
#include <windows.h>
// CRL_CONTEXT (x64 40 / x86 20 バイト)
typedef struct CRL_CONTEXT {
CERT_QUERY_ENCODING_TYPE dwCertEncodingType;
BYTE* pbCrlEncoded;
DWORD cbCrlEncoded;
CRL_INFO* pCrlInfo;
HCERTSTORE hCertStore;
} CRL_CONTEXT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRL_CONTEXT
{
public uint dwCertEncodingType;
public IntPtr pbCrlEncoded;
public uint cbCrlEncoded;
public IntPtr pCrlInfo;
public IntPtr hCertStore;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRL_CONTEXT
Public dwCertEncodingType As UInteger
Public pbCrlEncoded As IntPtr
Public cbCrlEncoded As UInteger
Public pCrlInfo As IntPtr
Public hCertStore As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class CRL_CONTEXT(ctypes.Structure):
_fields_ = [
("dwCertEncodingType", wintypes.DWORD),
("pbCrlEncoded", ctypes.c_void_p),
("cbCrlEncoded", wintypes.DWORD),
("pCrlInfo", ctypes.c_void_p),
("hCertStore", ctypes.c_void_p),
]#[repr(C)]
pub struct CRL_CONTEXT {
pub dwCertEncodingType: u32,
pub pbCrlEncoded: *mut core::ffi::c_void,
pub cbCrlEncoded: u32,
pub pCrlInfo: *mut core::ffi::c_void,
pub hCertStore: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type CRL_CONTEXT struct {
dwCertEncodingType uint32
pbCrlEncoded uintptr
cbCrlEncoded uint32
pCrlInfo uintptr
hCertStore uintptr
}type
CRL_CONTEXT = record
dwCertEncodingType: DWORD;
pbCrlEncoded: Pointer;
cbCrlEncoded: DWORD;
pCrlInfo: Pointer;
hCertStore: Pointer;
end;const CRL_CONTEXT = extern struct {
dwCertEncodingType: u32,
pbCrlEncoded: ?*anyopaque,
cbCrlEncoded: u32,
pCrlInfo: ?*anyopaque,
hCertStore: ?*anyopaque,
};type
CRL_CONTEXT {.bycopy.} = object
dwCertEncodingType: uint32
pbCrlEncoded: pointer
cbCrlEncoded: uint32
pCrlInfo: pointer
hCertStore: pointerstruct CRL_CONTEXT
{
uint dwCertEncodingType;
void* pbCrlEncoded;
uint cbCrlEncoded;
void* pCrlInfo;
void* hCertStore;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CRL_CONTEXT サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwCertEncodingType : CERT_QUERY_ENCODING_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pbCrlEncoded : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cbCrlEncoded : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pCrlInfo : CRL_INFO* (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; hCertStore : HCERTSTORE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRL_CONTEXT サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwCertEncodingType : CERT_QUERY_ENCODING_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pbCrlEncoded : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cbCrlEncoded : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pCrlInfo : CRL_INFO* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; hCertStore : HCERTSTORE (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CRL_CONTEXT
#field int dwCertEncodingType
#field intptr pbCrlEncoded
#field int cbCrlEncoded
#field intptr pCrlInfo
#field intptr hCertStore
#endstruct
stdim st, CRL_CONTEXT ; NSTRUCT 変数を確保
st->dwCertEncodingType = 100
mes "dwCertEncodingType=" + st->dwCertEncodingType