ホーム › 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 正規化に使用するアルゴリズム (排他的 XML 正規化 アルゴリズムなど)。 この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_CANONICALIZATION_EXCLUSIVE が使用されます。 |
| digestAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +4 | +4 | メッセージ パートのダイジェストに使用するアルゴリズム (SHA-1、SHA-256、 SHA-384、SHA-512 など)。 この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_DIGEST_SHA1 が使用されます。 |
| symmetricSignatureAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +8 | +8 | メッセージ認証コード (MAC または対称署名とも呼ばれます) に使用する アルゴリズム (HMAC-SHA1、HMAC-SHA256、HMAC-SHA384、HMAC-SHA512 など)。 この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_SYMMETRIC_SIGNATURE_HMAC_SHA1 が使用されます。 |
| asymmetricSignatureAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +12 | +12 | 非対称署名に使用するアルゴリズム。 この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_ASYMMETRIC_SIGNATURE_RSA_SHA1 が使用されます。 |
| encryptionAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +16 | +16 | メッセージ パートの暗号化に使用するアルゴリズム。将来の使用のために予約済みです。WS_SECURITY_ALGORITHM_DEFAULT に設定してください。 |
| keyDerivationAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +20 | +20 | 他の対称キーからキーを派生させるために使用するアルゴリズム。 この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_KEY_DERIVATION_P_SHA1 が使用されます。 |
| symmetricKeyWrapAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +24 | +24 | 他の対称キーを使用して対称キーを暗号化するために使用する アルゴリズム。将来の使用のために予約済みです。WS_SECURITY_ALGORITHM_DEFAULT に設定してください。 |
| asymmetricKeyWrapAlgorithm | WS_SECURITY_ALGORITHM_ID | 4 | +28 | +28 | 非対称キーを使用して対称キーを暗号化するために使用する アルゴリズム。この値を WS_SECURITY_ALGORITHM_DEFAULT に設定すると、既定で WS_SECURITY_ALGORITHM_ASYMMETRIC_KEYWRAP_RSA_OAEP が使用されます。 |
| minSymmetricKeyLength | DWORD | 4 | +32 | +32 | 対称キー セキュリティ トークンの最小キー長 (ビット単位)。 この値を 0 に設定すると、既定で 128 ビットになります。 |
| maxSymmetricKeyLength | DWORD | 4 | +36 | +36 | 対称キー セキュリティ トークンの最大キー長 (ビット単位)。 この値を 0 に設定すると、既定で 512 ビットになります。 |
| minAsymmetricKeyLength | DWORD | 4 | +40 | +40 | 非対称キー セキュリティ トークンの最小キー長 (ビット単位)。 この値を 0 に設定すると、既定で 1024 ビットになります。 |
| maxAsymmetricKeyLength | DWORD | 4 | +44 | +44 | 非対称キー セキュリティ トークンの最大キー長 (ビット単位)。 この値を 0 に設定すると、既定で 16384 ビットになります。 |
| properties | WS_SECURITY_ALGORITHM_PROPERTY* | 8/4 | +48 | +48 | アルゴリズムのプロパティ。将来の使用のために予約済みです。NULL に設定してください。 |
| propertyCount | DWORD | 4 | +56 | +52 | properties 配列内のエントリ数。将来の使用のために予約済みです。0 に設定してください。 |
公式ドキュメント
WS-Security で使用するセキュリティ アルゴリズムとキーの長さを 定義します。この設定は、メッセージ セキュリティ バインドおよび 混合モード セキュリティ バインドに関係します。
解説(Remarks)
キーの派生を使用する場合、キー長の制限は、署名用または暗号化用の 派生トークンの派生元となるソース セキュリティ トークンに 適用されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// 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