ホーム › Networking.HttpServer › HTTP_SSL_INFO
HTTP_SSL_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ServerCertKeySize | WORD | 2 | +0 | +0 | サーバー証明書の署名に使用された公開キーのサイズ (バイト単位)。 |
| ConnectionKeySize | WORD | 2 | +2 | +2 | 現在のセッションの暗号化に使用される暗号キーのサイズ (バイト単位)。 |
| ServerCertIssuerSize | DWORD | 4 | +4 | +4 | pServerCertIssuer メンバーが指す文字列のサイズ (バイト単位)。終端の null 文字は含みません。 |
| ServerCertSubjectSize | DWORD | 4 | +8 | +8 | pServerCertSubject メンバーが指す文字列のサイズ (バイト単位)。終端の null 文字は含みません。 |
| pServerCertIssuer | LPSTR | 8/4 | +16 | +12 | 証明書を発行したエンティティの名前を指定する、null で終わるオクテット文字列へのポインターです。 |
| pServerCertSubject | LPSTR | 8/4 | +24 | +16 | 証明書が属するエンティティの名前を指定する、null で終わるオクテット文字列へのポインターです。 |
| pClientCertInfo | HTTP_SSL_CLIENT_CERT_INFO* | 8/4 | +32 | +20 | クライアント証明書を指定する HTTP_SSL_CLIENT_CERT_INFO 構造体へのポインターです。 |
| SslClientCertNegotiated | DWORD | 4 | +40 | +24 | 0 以外の場合、クライアント証明書が既にローカルに存在することを示します。 |
公式ドキュメント
HTTP_SSL_INFO 構造体には、Secure Sockets Layer (SSL) を使用する接続について、SSL ハンドシェイクを通じて取得したデータが格納されます。
解説(Remarks)
HTTP_SSL_INFO 構造体は、 HTTP_REQUEST 構造体の pSslInfo メンバーから指すことができます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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 Structureimport 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: uint32struct 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