Win32 API 日本語リファレンス
ホームNetworking.HttpServer › HTTP_SSL_INFO

HTTP_SSL_INFO

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
ServerCertKeySizeWORD2+0+0サーバー証明書の鍵サイズ(ビット数・WORD)である。
ConnectionKeySizeWORD2+2+2接続の鍵サイズ(ビット数・WORD)である。
ServerCertIssuerSizeDWORD4+4+4pServerCertIssuerのバイトサイズである。
ServerCertSubjectSizeDWORD4+8+8pServerCertSubjectのバイトサイズである。
pServerCertIssuerLPSTR8/4+16+12サーバー証明書の発行者情報を示すANSI文字列ポインターである。
pServerCertSubjectLPSTR8/4+24+16サーバー証明書のサブジェクト情報を示すANSI文字列ポインターである。
pClientCertInfoHTTP_SSL_CLIENT_CERT_INFO*8/4+32+20クライアント証明書情報HTTP_SSL_CLIENT_CERT_INFOへのポインターである。無い場合はNULL。
SslClientCertNegotiatedDWORD4+40+24クライアント証明書がネゴシエートされたかを示す値である。

各言語での定義

#include <windows.h>

// HTTP_SSL_INFO  (x64 48 / x86 28 バイト)
typedef struct HTTP_SSL_INFO {
    WORD ServerCertKeySize;
    WORD ConnectionKeySize;
    DWORD ServerCertIssuerSize;
    DWORD ServerCertSubjectSize;
    LPSTR pServerCertIssuer;
    LPSTR pServerCertSubject;
    HTTP_SSL_CLIENT_CERT_INFO* pClientCertInfo;
    DWORD SslClientCertNegotiated;
} HTTP_SSL_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HTTP_SSL_INFO
{
    public ushort ServerCertKeySize;
    public ushort ConnectionKeySize;
    public uint ServerCertIssuerSize;
    public uint ServerCertSubjectSize;
    public IntPtr pServerCertIssuer;
    public IntPtr pServerCertSubject;
    public IntPtr pClientCertInfo;
    public uint SslClientCertNegotiated;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HTTP_SSL_INFO
    Public ServerCertKeySize As UShort
    Public ConnectionKeySize As UShort
    Public ServerCertIssuerSize As UInteger
    Public ServerCertSubjectSize As UInteger
    Public pServerCertIssuer As IntPtr
    Public pServerCertSubject As IntPtr
    Public pClientCertInfo As IntPtr
    Public SslClientCertNegotiated As UInteger
End Structure
import ctypes
from ctypes import wintypes

class HTTP_SSL_INFO(ctypes.Structure):
    _fields_ = [
        ("ServerCertKeySize", ctypes.c_ushort),
        ("ConnectionKeySize", ctypes.c_ushort),
        ("ServerCertIssuerSize", wintypes.DWORD),
        ("ServerCertSubjectSize", wintypes.DWORD),
        ("pServerCertIssuer", ctypes.c_void_p),
        ("pServerCertSubject", ctypes.c_void_p),
        ("pClientCertInfo", ctypes.c_void_p),
        ("SslClientCertNegotiated", wintypes.DWORD),
    ]
#[repr(C)]
pub struct HTTP_SSL_INFO {
    pub ServerCertKeySize: u16,
    pub ConnectionKeySize: u16,
    pub ServerCertIssuerSize: u32,
    pub ServerCertSubjectSize: u32,
    pub pServerCertIssuer: *mut core::ffi::c_void,
    pub pServerCertSubject: *mut core::ffi::c_void,
    pub pClientCertInfo: *mut core::ffi::c_void,
    pub SslClientCertNegotiated: u32,
}
import "golang.org/x/sys/windows"

type HTTP_SSL_INFO struct {
	ServerCertKeySize uint16
	ConnectionKeySize uint16
	ServerCertIssuerSize uint32
	ServerCertSubjectSize uint32
	pServerCertIssuer uintptr
	pServerCertSubject uintptr
	pClientCertInfo uintptr
	SslClientCertNegotiated uint32
}
type
  HTTP_SSL_INFO = record
    ServerCertKeySize: Word;
    ConnectionKeySize: Word;
    ServerCertIssuerSize: DWORD;
    ServerCertSubjectSize: DWORD;
    pServerCertIssuer: Pointer;
    pServerCertSubject: Pointer;
    pClientCertInfo: Pointer;
    SslClientCertNegotiated: DWORD;
  end;
const HTTP_SSL_INFO = extern struct {
    ServerCertKeySize: u16,
    ConnectionKeySize: u16,
    ServerCertIssuerSize: u32,
    ServerCertSubjectSize: u32,
    pServerCertIssuer: ?*anyopaque,
    pServerCertSubject: ?*anyopaque,
    pClientCertInfo: ?*anyopaque,
    SslClientCertNegotiated: u32,
};
type
  HTTP_SSL_INFO {.bycopy.} = object
    ServerCertKeySize: uint16
    ConnectionKeySize: uint16
    ServerCertIssuerSize: uint32
    ServerCertSubjectSize: uint32
    pServerCertIssuer: pointer
    pServerCertSubject: pointer
    pClientCertInfo: pointer
    SslClientCertNegotiated: uint32
struct HTTP_SSL_INFO
{
    ushort ServerCertKeySize;
    ushort ConnectionKeySize;
    uint ServerCertIssuerSize;
    uint ServerCertSubjectSize;
    void* pServerCertIssuer;
    void* pServerCertSubject;
    void* pClientCertInfo;
    uint SslClientCertNegotiated;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HTTP_SSL_INFO サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; ServerCertKeySize : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; ConnectionKeySize : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; ServerCertIssuerSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ServerCertSubjectSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pServerCertIssuer : LPSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pServerCertSubject : LPSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pClientCertInfo : HTTP_SSL_CLIENT_CERT_INFO* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; SslClientCertNegotiated : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HTTP_SSL_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; ServerCertKeySize : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; ConnectionKeySize : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; ServerCertIssuerSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ServerCertSubjectSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pServerCertIssuer : LPSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pServerCertSubject : LPSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pClientCertInfo : HTTP_SSL_CLIENT_CERT_INFO* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; SslClientCertNegotiated : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HTTP_SSL_INFO
    #field short ServerCertKeySize
    #field short ConnectionKeySize
    #field int ServerCertIssuerSize
    #field int ServerCertSubjectSize
    #field intptr pServerCertIssuer
    #field intptr pServerCertSubject
    #field intptr pClientCertInfo
    #field int SslClientCertNegotiated
#endstruct

stdim st, HTTP_SSL_INFO        ; NSTRUCT 変数を確保
st->ServerCertKeySize = 100
mes "ServerCertKeySize=" + st->ServerCertKeySize