ホーム › Networking.WindowsWebServices › WS_SECURITY_ALGORITHM_SUITE
WS_SECURITY_ALGORITHM_SUITE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| canonicalizationAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +0 | +0 | XML正規化に用いるアルゴリズムを示すID。 |
| digestAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +4 | +4 | ダイジェスト(ハッシュ)計算に用いるアルゴリズムを示すID。 |
| symmetricSignatureAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +8 | +8 | 対称鍵による署名に用いるアルゴリズムを示すID。 |
| asymmetricSignatureAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +12 | +12 | 非対称鍵による署名に用いるアルゴリズムを示すID。 |
| encryptionAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +16 | +16 | データ暗号化に用いるアルゴリズムを示すID。 |
| keyDerivationAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +20 | +20 | 鍵導出に用いるアルゴリズムを示すID。 |
| symmetricKeyWrapAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +24 | +24 | 対称鍵のラップ(鍵暗号化)に用いるアルゴリズムを示すID。 |
| asymmetricKeyWrapAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +28 | +28 | 非対称鍵によるラップに用いるアルゴリズムを示すID。 |
| minSymmetricKeyLength | DWORD | 4 | +32 | +32 | 許容する対称鍵長の最小値(ビット)。 |
| maxSymmetricKeyLength | DWORD | 4 | +36 | +36 | 許容する対称鍵長の最大値(ビット)。 |
| minAsymmetricKeyLength | DWORD | 4 | +40 | +40 | 許容する非対称鍵長の最小値(ビット)。 |
| maxAsymmetricKeyLength | DWORD | 4 | +44 | +44 | 許容する非対称鍵長の最大値(ビット)。 |
| properties | WS_SECURITY_ALGORITHM_PROPERTY* | 8/4 | +48 | +48 | アルゴリズムスイートの追加プロパティ配列へのポインタ。NULL可。 |
| propertyCount | DWORD | 4 | +56 | +52 | properties配列の要素数。 |
各言語での定義
#include <windows.h>
// WS_SECURITY_ALGORITHM_SUITE (x64 64 / x86 56 バイト)
typedef struct WS_SECURITY_ALGORITHM_SUITE {
WS_SECURITY_ALGORITHM_ID canonicalizationAlgorithm;
WS_SECURITY_ALGORITHM_ID digestAlgorithm;
WS_SECURITY_ALGORITHM_ID symmetricSignatureAlgorithm;
WS_SECURITY_ALGORITHM_ID asymmetricSignatureAlgorithm;
WS_SECURITY_ALGORITHM_ID encryptionAlgorithm;
WS_SECURITY_ALGORITHM_ID keyDerivationAlgorithm;
WS_SECURITY_ALGORITHM_ID symmetricKeyWrapAlgorithm;
WS_SECURITY_ALGORITHM_ID asymmetricKeyWrapAlgorithm;
DWORD minSymmetricKeyLength;
DWORD maxSymmetricKeyLength;
DWORD minAsymmetricKeyLength;
DWORD maxAsymmetricKeyLength;
WS_SECURITY_ALGORITHM_PROPERTY* properties;
DWORD propertyCount;
} WS_SECURITY_ALGORITHM_SUITE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_SECURITY_ALGORITHM_SUITE
{
public int canonicalizationAlgorithm;
public int digestAlgorithm;
public int symmetricSignatureAlgorithm;
public int asymmetricSignatureAlgorithm;
public int encryptionAlgorithm;
public int keyDerivationAlgorithm;
public int symmetricKeyWrapAlgorithm;
public int asymmetricKeyWrapAlgorithm;
public uint minSymmetricKeyLength;
public uint maxSymmetricKeyLength;
public uint minAsymmetricKeyLength;
public uint maxAsymmetricKeyLength;
public IntPtr properties;
public uint propertyCount;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_SECURITY_ALGORITHM_SUITE
Public canonicalizationAlgorithm As Integer
Public digestAlgorithm As Integer
Public symmetricSignatureAlgorithm As Integer
Public asymmetricSignatureAlgorithm As Integer
Public encryptionAlgorithm As Integer
Public keyDerivationAlgorithm As Integer
Public symmetricKeyWrapAlgorithm As Integer
Public asymmetricKeyWrapAlgorithm As Integer
Public minSymmetricKeyLength As UInteger
Public maxSymmetricKeyLength As UInteger
Public minAsymmetricKeyLength As UInteger
Public maxAsymmetricKeyLength As UInteger
Public properties As IntPtr
Public propertyCount As UInteger
End Structureimport ctypes
from ctypes import wintypes
class WS_SECURITY_ALGORITHM_SUITE(ctypes.Structure):
_fields_ = [
("canonicalizationAlgorithm", ctypes.c_int),
("digestAlgorithm", ctypes.c_int),
("symmetricSignatureAlgorithm", ctypes.c_int),
("asymmetricSignatureAlgorithm", ctypes.c_int),
("encryptionAlgorithm", ctypes.c_int),
("keyDerivationAlgorithm", ctypes.c_int),
("symmetricKeyWrapAlgorithm", ctypes.c_int),
("asymmetricKeyWrapAlgorithm", ctypes.c_int),
("minSymmetricKeyLength", wintypes.DWORD),
("maxSymmetricKeyLength", wintypes.DWORD),
("minAsymmetricKeyLength", wintypes.DWORD),
("maxAsymmetricKeyLength", wintypes.DWORD),
("properties", ctypes.c_void_p),
("propertyCount", wintypes.DWORD),
]#[repr(C)]
pub struct WS_SECURITY_ALGORITHM_SUITE {
pub canonicalizationAlgorithm: i32,
pub digestAlgorithm: i32,
pub symmetricSignatureAlgorithm: i32,
pub asymmetricSignatureAlgorithm: i32,
pub encryptionAlgorithm: i32,
pub keyDerivationAlgorithm: i32,
pub symmetricKeyWrapAlgorithm: i32,
pub asymmetricKeyWrapAlgorithm: i32,
pub minSymmetricKeyLength: u32,
pub maxSymmetricKeyLength: u32,
pub minAsymmetricKeyLength: u32,
pub maxAsymmetricKeyLength: u32,
pub properties: *mut core::ffi::c_void,
pub propertyCount: u32,
}import "golang.org/x/sys/windows"
type WS_SECURITY_ALGORITHM_SUITE struct {
canonicalizationAlgorithm int32
digestAlgorithm int32
symmetricSignatureAlgorithm int32
asymmetricSignatureAlgorithm int32
encryptionAlgorithm int32
keyDerivationAlgorithm int32
symmetricKeyWrapAlgorithm int32
asymmetricKeyWrapAlgorithm int32
minSymmetricKeyLength uint32
maxSymmetricKeyLength uint32
minAsymmetricKeyLength uint32
maxAsymmetricKeyLength uint32
properties uintptr
propertyCount uint32
}type
WS_SECURITY_ALGORITHM_SUITE = record
canonicalizationAlgorithm: Integer;
digestAlgorithm: Integer;
symmetricSignatureAlgorithm: Integer;
asymmetricSignatureAlgorithm: Integer;
encryptionAlgorithm: Integer;
keyDerivationAlgorithm: Integer;
symmetricKeyWrapAlgorithm: Integer;
asymmetricKeyWrapAlgorithm: Integer;
minSymmetricKeyLength: DWORD;
maxSymmetricKeyLength: DWORD;
minAsymmetricKeyLength: DWORD;
maxAsymmetricKeyLength: DWORD;
properties: Pointer;
propertyCount: DWORD;
end;const WS_SECURITY_ALGORITHM_SUITE = extern struct {
canonicalizationAlgorithm: i32,
digestAlgorithm: i32,
symmetricSignatureAlgorithm: i32,
asymmetricSignatureAlgorithm: i32,
encryptionAlgorithm: i32,
keyDerivationAlgorithm: i32,
symmetricKeyWrapAlgorithm: i32,
asymmetricKeyWrapAlgorithm: i32,
minSymmetricKeyLength: u32,
maxSymmetricKeyLength: u32,
minAsymmetricKeyLength: u32,
maxAsymmetricKeyLength: u32,
properties: ?*anyopaque,
propertyCount: u32,
};type
WS_SECURITY_ALGORITHM_SUITE {.bycopy.} = object
canonicalizationAlgorithm: int32
digestAlgorithm: int32
symmetricSignatureAlgorithm: int32
asymmetricSignatureAlgorithm: int32
encryptionAlgorithm: int32
keyDerivationAlgorithm: int32
symmetricKeyWrapAlgorithm: int32
asymmetricKeyWrapAlgorithm: int32
minSymmetricKeyLength: uint32
maxSymmetricKeyLength: uint32
minAsymmetricKeyLength: uint32
maxAsymmetricKeyLength: uint32
properties: pointer
propertyCount: uint32struct WS_SECURITY_ALGORITHM_SUITE
{
int canonicalizationAlgorithm;
int digestAlgorithm;
int symmetricSignatureAlgorithm;
int asymmetricSignatureAlgorithm;
int encryptionAlgorithm;
int keyDerivationAlgorithm;
int symmetricKeyWrapAlgorithm;
int asymmetricKeyWrapAlgorithm;
uint minSymmetricKeyLength;
uint maxSymmetricKeyLength;
uint minAsymmetricKeyLength;
uint maxAsymmetricKeyLength;
void* properties;
uint propertyCount;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WS_SECURITY_ALGORITHM_SUITE サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; canonicalizationAlgorithm : WS_SECURITY_ALGORITHM_ID (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; digestAlgorithm : WS_SECURITY_ALGORITHM_ID (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; symmetricSignatureAlgorithm : WS_SECURITY_ALGORITHM_ID (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; asymmetricSignatureAlgorithm : WS_SECURITY_ALGORITHM_ID (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; encryptionAlgorithm : WS_SECURITY_ALGORITHM_ID (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; keyDerivationAlgorithm : WS_SECURITY_ALGORITHM_ID (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; symmetricKeyWrapAlgorithm : WS_SECURITY_ALGORITHM_ID (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; asymmetricKeyWrapAlgorithm : WS_SECURITY_ALGORITHM_ID (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; minSymmetricKeyLength : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; maxSymmetricKeyLength : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; minAsymmetricKeyLength : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; maxAsymmetricKeyLength : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; properties : WS_SECURITY_ALGORITHM_PROPERTY* (+48, 4byte) varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; propertyCount : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_SECURITY_ALGORITHM_SUITE サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; canonicalizationAlgorithm : WS_SECURITY_ALGORITHM_ID (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; digestAlgorithm : WS_SECURITY_ALGORITHM_ID (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; symmetricSignatureAlgorithm : WS_SECURITY_ALGORITHM_ID (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; asymmetricSignatureAlgorithm : WS_SECURITY_ALGORITHM_ID (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; encryptionAlgorithm : WS_SECURITY_ALGORITHM_ID (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; keyDerivationAlgorithm : WS_SECURITY_ALGORITHM_ID (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; symmetricKeyWrapAlgorithm : WS_SECURITY_ALGORITHM_ID (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; asymmetricKeyWrapAlgorithm : WS_SECURITY_ALGORITHM_ID (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; minSymmetricKeyLength : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; maxSymmetricKeyLength : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; minAsymmetricKeyLength : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; maxAsymmetricKeyLength : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; properties : WS_SECURITY_ALGORITHM_PROPERTY* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; propertyCount : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WS_SECURITY_ALGORITHM_SUITE
#field int canonicalizationAlgorithm
#field int digestAlgorithm
#field int symmetricSignatureAlgorithm
#field int asymmetricSignatureAlgorithm
#field int encryptionAlgorithm
#field int keyDerivationAlgorithm
#field int symmetricKeyWrapAlgorithm
#field int asymmetricKeyWrapAlgorithm
#field int minSymmetricKeyLength
#field int maxSymmetricKeyLength
#field int minAsymmetricKeyLength
#field int maxAsymmetricKeyLength
#field intptr properties
#field int propertyCount
#endstruct
stdim st, WS_SECURITY_ALGORITHM_SUITE ; NSTRUCT 変数を確保
st->canonicalizationAlgorithm = 100
mes "canonicalizationAlgorithm=" + st->canonicalizationAlgorithm