ホーム › Security.Cryptography › CERT_REVOCATION_STATUS
CERT_REVOCATION_STATUS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズ(バイト単位)。呼び出し前に設定が必要。 |
| dwIndex | DWORD | 4 | +4 | +4 | 失効した証明書の配列内インデックス。 |
| dwError | DWORD | 4 | +8 | +8 | 失効確認のエラーコード。0は成功。 |
| dwReason | CERT_REVOCATION_STATUS_REASON | 4 | +12 | +12 | 失効理由を示すコード。 |
| fHasFreshnessTime | BOOL | 4 | +16 | +16 | dwFreshnessTimeが有効かを示すブール値。 |
| dwFreshnessTime | DWORD | 4 | +20 | +20 | 失効情報の鮮度(秒単位)。fHasFreshnessTimeがTRUEで有効。 |
各言語での定義
#include <windows.h>
// CERT_REVOCATION_STATUS (x64 24 / x86 24 バイト)
typedef struct CERT_REVOCATION_STATUS {
DWORD cbSize;
DWORD dwIndex;
DWORD dwError;
CERT_REVOCATION_STATUS_REASON dwReason;
BOOL fHasFreshnessTime;
DWORD dwFreshnessTime;
} CERT_REVOCATION_STATUS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CERT_REVOCATION_STATUS
{
public uint cbSize;
public uint dwIndex;
public uint dwError;
public uint dwReason;
[MarshalAs(UnmanagedType.Bool)] public bool fHasFreshnessTime;
public uint dwFreshnessTime;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CERT_REVOCATION_STATUS
Public cbSize As UInteger
Public dwIndex As UInteger
Public dwError As UInteger
Public dwReason As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fHasFreshnessTime As Boolean
Public dwFreshnessTime As UInteger
End Structureimport ctypes
from ctypes import wintypes
class CERT_REVOCATION_STATUS(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwIndex", wintypes.DWORD),
("dwError", wintypes.DWORD),
("dwReason", wintypes.DWORD),
("fHasFreshnessTime", wintypes.BOOL),
("dwFreshnessTime", wintypes.DWORD),
]#[repr(C)]
pub struct CERT_REVOCATION_STATUS {
pub cbSize: u32,
pub dwIndex: u32,
pub dwError: u32,
pub dwReason: u32,
pub fHasFreshnessTime: i32,
pub dwFreshnessTime: u32,
}import "golang.org/x/sys/windows"
type CERT_REVOCATION_STATUS struct {
cbSize uint32
dwIndex uint32
dwError uint32
dwReason uint32
fHasFreshnessTime int32
dwFreshnessTime uint32
}type
CERT_REVOCATION_STATUS = record
cbSize: DWORD;
dwIndex: DWORD;
dwError: DWORD;
dwReason: DWORD;
fHasFreshnessTime: BOOL;
dwFreshnessTime: DWORD;
end;const CERT_REVOCATION_STATUS = extern struct {
cbSize: u32,
dwIndex: u32,
dwError: u32,
dwReason: u32,
fHasFreshnessTime: i32,
dwFreshnessTime: u32,
};type
CERT_REVOCATION_STATUS {.bycopy.} = object
cbSize: uint32
dwIndex: uint32
dwError: uint32
dwReason: uint32
fHasFreshnessTime: int32
dwFreshnessTime: uint32struct CERT_REVOCATION_STATUS
{
uint cbSize;
uint dwIndex;
uint dwError;
uint dwReason;
int fHasFreshnessTime;
uint dwFreshnessTime;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CERT_REVOCATION_STATUS サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwError : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwReason : CERT_REVOCATION_STATUS_REASON (+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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CERT_REVOCATION_STATUS
#field int cbSize
#field int dwIndex
#field int dwError
#field int dwReason
#field bool fHasFreshnessTime
#field int dwFreshnessTime
#endstruct
stdim st, CERT_REVOCATION_STATUS ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize