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