ホーム › Security.Authentication.Identity › SecPkgContext_ConnectionInfo
SecPkgContext_ConnectionInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dwProtocol | DWORD | 4 | +0 | +0 | この接続の確立に使用されたプロトコルです。次の表に、このメンバーに指定できる定数を示します。
| ||||||||||||||||||||||||||||||||||
| aiCipher | ALG_ID | 4 | +4 | +4 | この接続で使用されるバルク暗号化の暗号アルゴリズム識別子 (ALG_ID) です。次の表に、このメンバーに指定できる定数を示します。
| ||||||||||||||||||||||||||||||||||
| dwCipherStrength | DWORD | 4 | +8 | +8 | バルク暗号化の暗号強度 (ビット単位) です。0、40、56、128、168、256 のいずれかの値になります。 | ||||||||||||||||||||||||||||||||||
| aiHash | ALG_ID | 4 | +12 | +12 | メッセージ認証コード (MAC) の生成に使用されるハッシュを示す ALG_ID です。次の表に、このメンバーに指定できる定数を示します。
| ||||||||||||||||||||||||||||||||||
| dwHashStrength | DWORD | 4 | +16 | +16 | ハッシュの強度 (ビット単位) です。128 または 160 です。 | ||||||||||||||||||||||||||||||||||
| aiExch | ALG_ID | 4 | +20 | +20 | 共有マスター シークレットの生成に使用されるキー交換アルゴリズムを示す ALG_ID です。次の表に、このメンバーに指定できる定数を示します。
| ||||||||||||||||||||||||||||||||||
| dwExchStrength | DWORD | 4 | +24 | +24 | キーの長さ (ビット単位) です。RSA キー交換の場合、このメンバーには通常 512、768、1024、2048 のいずれかの値が格納されます。Diffie-Hellman キー交換の場合、このメンバーには通常 224、256、384、512 のいずれかの値が格納されます。 |
公式ドキュメント
SecPkgContext_ConnectionInfo 構造体には、プロトコルと暗号に関する情報が格納されます。この構造体は InitializeSecurityContext (Schannel) 関数で使用されます。
この属性は Schannel セキュリティ サポート プロバイダー (SSP) でのみサポートされます。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// SecPkgContext_ConnectionInfo (x64 28 / x86 28 バイト)
typedef struct SecPkgContext_ConnectionInfo {
DWORD dwProtocol;
ALG_ID aiCipher;
DWORD dwCipherStrength;
ALG_ID aiHash;
DWORD dwHashStrength;
ALG_ID aiExch;
DWORD dwExchStrength;
} SecPkgContext_ConnectionInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_ConnectionInfo
{
public uint dwProtocol;
public uint aiCipher;
public uint dwCipherStrength;
public uint aiHash;
public uint dwHashStrength;
public uint aiExch;
public uint dwExchStrength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_ConnectionInfo
Public dwProtocol As UInteger
Public aiCipher As UInteger
Public dwCipherStrength As UInteger
Public aiHash As UInteger
Public dwHashStrength As UInteger
Public aiExch As UInteger
Public dwExchStrength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SecPkgContext_ConnectionInfo(ctypes.Structure):
_fields_ = [
("dwProtocol", wintypes.DWORD),
("aiCipher", wintypes.DWORD),
("dwCipherStrength", wintypes.DWORD),
("aiHash", wintypes.DWORD),
("dwHashStrength", wintypes.DWORD),
("aiExch", wintypes.DWORD),
("dwExchStrength", wintypes.DWORD),
]#[repr(C)]
pub struct SecPkgContext_ConnectionInfo {
pub dwProtocol: u32,
pub aiCipher: u32,
pub dwCipherStrength: u32,
pub aiHash: u32,
pub dwHashStrength: u32,
pub aiExch: u32,
pub dwExchStrength: u32,
}import "golang.org/x/sys/windows"
type SecPkgContext_ConnectionInfo struct {
dwProtocol uint32
aiCipher uint32
dwCipherStrength uint32
aiHash uint32
dwHashStrength uint32
aiExch uint32
dwExchStrength uint32
}type
SecPkgContext_ConnectionInfo = record
dwProtocol: DWORD;
aiCipher: DWORD;
dwCipherStrength: DWORD;
aiHash: DWORD;
dwHashStrength: DWORD;
aiExch: DWORD;
dwExchStrength: DWORD;
end;const SecPkgContext_ConnectionInfo = extern struct {
dwProtocol: u32,
aiCipher: u32,
dwCipherStrength: u32,
aiHash: u32,
dwHashStrength: u32,
aiExch: u32,
dwExchStrength: u32,
};type
SecPkgContext_ConnectionInfo {.bycopy.} = object
dwProtocol: uint32
aiCipher: uint32
dwCipherStrength: uint32
aiHash: uint32
dwHashStrength: uint32
aiExch: uint32
dwExchStrength: uint32struct SecPkgContext_ConnectionInfo
{
uint dwProtocol;
uint aiCipher;
uint dwCipherStrength;
uint aiHash;
uint dwHashStrength;
uint aiExch;
uint dwExchStrength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgContext_ConnectionInfo サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwProtocol : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; aiCipher : ALG_ID (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwCipherStrength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; aiHash : ALG_ID (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwHashStrength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; aiExch : ALG_ID (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwExchStrength : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgContext_ConnectionInfo
#field int dwProtocol
#field int aiCipher
#field int dwCipherStrength
#field int aiHash
#field int dwHashStrength
#field int aiExch
#field int dwExchStrength
#endstruct
stdim st, SecPkgContext_ConnectionInfo ; NSTRUCT 変数を確保
st->dwProtocol = 100
mes "dwProtocol=" + st->dwProtocol