Win32 API 日本語リファレンス
ホームSecurity.Cryptography › CRL_DIST_POINT

CRL_DIST_POINT

構造体
サイズx64: 64 バイト / x86: 32 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
DistPointNameCRL_DIST_POINT_NAME24/12+0+0CRL配布点の名前(CRL_DIST_POINT_NAME)。
ReasonFlagsCRYPT_BIT_BLOB24/12+24+12この配布点が対象とする失効理由を示すビットBLOB。
CRLIssuerCERT_ALT_NAME_INFO16/8+48+24CRL発行者の代替名(CERT_ALT_NAME_INFO)。

各言語での定義

#include <windows.h>

// CRL_DIST_POINT_NAME  (x64 24 / x86 12 バイト)
typedef struct CRL_DIST_POINT_NAME {
    DWORD dwDistPointNameChoice;
    _Anonymous_e__Union Anonymous;
} CRL_DIST_POINT_NAME;

// CRYPT_BIT_BLOB  (x64 24 / x86 12 バイト)
typedef struct CRYPT_BIT_BLOB {
    DWORD cbData;
    BYTE* pbData;
    DWORD cUnusedBits;
} CRYPT_BIT_BLOB;

// CERT_ALT_NAME_INFO  (x64 16 / x86 8 バイト)
typedef struct CERT_ALT_NAME_INFO {
    DWORD cAltEntry;
    CERT_ALT_NAME_ENTRY* rgAltEntry;
} CERT_ALT_NAME_INFO;

// CRL_DIST_POINT  (x64 64 / x86 32 バイト)
typedef struct CRL_DIST_POINT {
    CRL_DIST_POINT_NAME DistPointName;
    CRYPT_BIT_BLOB ReasonFlags;
    CERT_ALT_NAME_INFO CRLIssuer;
} CRL_DIST_POINT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRL_DIST_POINT_NAME
{
    public uint dwDistPointNameChoice;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPT_BIT_BLOB
{
    public uint cbData;
    public IntPtr pbData;
    public uint cUnusedBits;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CERT_ALT_NAME_INFO
{
    public uint cAltEntry;
    public IntPtr rgAltEntry;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRL_DIST_POINT
{
    public CRL_DIST_POINT_NAME DistPointName;
    public CRYPT_BIT_BLOB ReasonFlags;
    public CERT_ALT_NAME_INFO CRLIssuer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRL_DIST_POINT_NAME
    Public dwDistPointNameChoice As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPT_BIT_BLOB
    Public cbData As UInteger
    Public pbData As IntPtr
    Public cUnusedBits As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CERT_ALT_NAME_INFO
    Public cAltEntry As UInteger
    Public rgAltEntry As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRL_DIST_POINT
    Public DistPointName As CRL_DIST_POINT_NAME
    Public ReasonFlags As CRYPT_BIT_BLOB
    Public CRLIssuer As CERT_ALT_NAME_INFO
End Structure
import ctypes
from ctypes import wintypes

class CRL_DIST_POINT_NAME(ctypes.Structure):
    _fields_ = [
        ("dwDistPointNameChoice", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class CRYPT_BIT_BLOB(ctypes.Structure):
    _fields_ = [
        ("cbData", wintypes.DWORD),
        ("pbData", ctypes.c_void_p),
        ("cUnusedBits", wintypes.DWORD),
    ]

class CERT_ALT_NAME_INFO(ctypes.Structure):
    _fields_ = [
        ("cAltEntry", wintypes.DWORD),
        ("rgAltEntry", ctypes.c_void_p),
    ]

class CRL_DIST_POINT(ctypes.Structure):
    _fields_ = [
        ("DistPointName", CRL_DIST_POINT_NAME),
        ("ReasonFlags", CRYPT_BIT_BLOB),
        ("CRLIssuer", CERT_ALT_NAME_INFO),
    ]
#[repr(C)]
pub struct CRL_DIST_POINT_NAME {
    pub dwDistPointNameChoice: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct CRYPT_BIT_BLOB {
    pub cbData: u32,
    pub pbData: *mut core::ffi::c_void,
    pub cUnusedBits: u32,
}

#[repr(C)]
pub struct CERT_ALT_NAME_INFO {
    pub cAltEntry: u32,
    pub rgAltEntry: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct CRL_DIST_POINT {
    pub DistPointName: CRL_DIST_POINT_NAME,
    pub ReasonFlags: CRYPT_BIT_BLOB,
    pub CRLIssuer: CERT_ALT_NAME_INFO,
}
import "golang.org/x/sys/windows"

type CRL_DIST_POINT_NAME struct {
	dwDistPointNameChoice uint32
	Anonymous _Anonymous_e__Union
}

type CRYPT_BIT_BLOB struct {
	cbData uint32
	pbData uintptr
	cUnusedBits uint32
}

type CERT_ALT_NAME_INFO struct {
	cAltEntry uint32
	rgAltEntry uintptr
}

type CRL_DIST_POINT struct {
	DistPointName CRL_DIST_POINT_NAME
	ReasonFlags CRYPT_BIT_BLOB
	CRLIssuer CERT_ALT_NAME_INFO
}
type
  CRL_DIST_POINT_NAME = record
    dwDistPointNameChoice: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  CRYPT_BIT_BLOB = record
    cbData: DWORD;
    pbData: Pointer;
    cUnusedBits: DWORD;
  end;

  CERT_ALT_NAME_INFO = record
    cAltEntry: DWORD;
    rgAltEntry: Pointer;
  end;

  CRL_DIST_POINT = record
    DistPointName: CRL_DIST_POINT_NAME;
    ReasonFlags: CRYPT_BIT_BLOB;
    CRLIssuer: CERT_ALT_NAME_INFO;
  end;
const CRL_DIST_POINT_NAME = extern struct {
    dwDistPointNameChoice: u32,
    Anonymous: _Anonymous_e__Union,
};

const CRYPT_BIT_BLOB = extern struct {
    cbData: u32,
    pbData: ?*anyopaque,
    cUnusedBits: u32,
};

const CERT_ALT_NAME_INFO = extern struct {
    cAltEntry: u32,
    rgAltEntry: ?*anyopaque,
};

const CRL_DIST_POINT = extern struct {
    DistPointName: CRL_DIST_POINT_NAME,
    ReasonFlags: CRYPT_BIT_BLOB,
    CRLIssuer: CERT_ALT_NAME_INFO,
};
type
  CRL_DIST_POINT_NAME {.bycopy.} = object
    dwDistPointNameChoice: uint32
    Anonymous: _Anonymous_e__Union

  CRYPT_BIT_BLOB {.bycopy.} = object
    cbData: uint32
    pbData: pointer
    cUnusedBits: uint32

  CERT_ALT_NAME_INFO {.bycopy.} = object
    cAltEntry: uint32
    rgAltEntry: pointer

  CRL_DIST_POINT {.bycopy.} = object
    DistPointName: CRL_DIST_POINT_NAME
    ReasonFlags: CRYPT_BIT_BLOB
    CRLIssuer: CERT_ALT_NAME_INFO
struct CRL_DIST_POINT_NAME
{
    uint dwDistPointNameChoice;
    _Anonymous_e__Union Anonymous;
}

struct CRYPT_BIT_BLOB
{
    uint cbData;
    void* pbData;
    uint cUnusedBits;
}

struct CERT_ALT_NAME_INFO
{
    uint cAltEntry;
    void* rgAltEntry;
}

struct CRL_DIST_POINT
{
    CRL_DIST_POINT_NAME DistPointName;
    CRYPT_BIT_BLOB ReasonFlags;
    CERT_ALT_NAME_INFO CRLIssuer;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CRL_DIST_POINT サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; DistPointName : CRL_DIST_POINT_NAME (+0, 12byte)  varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; ReasonFlags : CRYPT_BIT_BLOB (+12, 12byte)  varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; CRLIssuer : CERT_ALT_NAME_INFO (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRL_DIST_POINT サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; DistPointName : CRL_DIST_POINT_NAME (+0, 24byte)  varptr(st)+0 を基点に操作(24byte:入れ子/配列)
; ReasonFlags : CRYPT_BIT_BLOB (+24, 24byte)  varptr(st)+24 を基点に操作(24byte:入れ子/配列)
; CRLIssuer : CERT_ALT_NAME_INFO (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CRL_DIST_POINT_NAME
    #field int dwDistPointNameChoice
    #field byte Anonymous 16
#endstruct

#defstruct global CRYPT_BIT_BLOB
    #field int cbData
    #field intptr pbData
    #field int cUnusedBits
#endstruct

#defstruct global CERT_ALT_NAME_INFO
    #field int cAltEntry
    #field intptr rgAltEntry
#endstruct

#defstruct global CRL_DIST_POINT
    #field CRL_DIST_POINT_NAME DistPointName
    #field CRYPT_BIT_BLOB ReasonFlags
    #field CERT_ALT_NAME_INFO CRLIssuer
#endstruct

stdim st, CRL_DIST_POINT        ; NSTRUCT 変数を確保