ホーム › Security.Cryptography.Catalog › CRYPTCATSTORE
CRYPTCATSTORE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| dwPublicVersion | DWORD | 4 | +4 | +4 | カタログの公開バージョン番号。 |
| pwszP7File | LPWSTR | 8/4 | +8 | +8 | カタログのPKCS#7署名ファイルパス(Unicode)。 |
| hProv | UINT_PTR | 8/4 | +16 | +12 | 暗号化サービスプロバイダー(CSP)のハンドル。 |
| dwEncodingType | DWORD | 4 | +24 | +16 | 証明書やメッセージのエンコード種別。 |
| fdwStoreFlags | CRYPTCAT_OPEN_FLAGS | 4 | +28 | +20 | カタログストアのオープン動作を示すCRYPTCAT_OPEN_FLAGS値。 |
| hReserved | HANDLE | 8/4 | +32 | +24 | 予約済みハンドル。 |
| hAttrs | HANDLE | 8/4 | +40 | +28 | カタログ属性のハンドル。 |
| hCryptMsg | void* | 8/4 | +48 | +32 | カタログの暗号化メッセージへのハンドル。 |
| hSorted | HANDLE | 8/4 | +56 | +36 | ソート済みデータのハンドル。 |
各言語での定義
#include <windows.h>
// CRYPTCATSTORE (x64 64 / x86 40 バイト)
typedef struct CRYPTCATSTORE {
DWORD cbStruct;
DWORD dwPublicVersion;
LPWSTR pwszP7File;
UINT_PTR hProv;
DWORD dwEncodingType;
CRYPTCAT_OPEN_FLAGS fdwStoreFlags;
HANDLE hReserved;
HANDLE hAttrs;
void* hCryptMsg;
HANDLE hSorted;
} CRYPTCATSTORE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPTCATSTORE
{
public uint cbStruct;
public uint dwPublicVersion;
public IntPtr pwszP7File;
public UIntPtr hProv;
public uint dwEncodingType;
public uint fdwStoreFlags;
public IntPtr hReserved;
public IntPtr hAttrs;
public IntPtr hCryptMsg;
public IntPtr hSorted;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPTCATSTORE
Public cbStruct As UInteger
Public dwPublicVersion As UInteger
Public pwszP7File As IntPtr
Public hProv As UIntPtr
Public dwEncodingType As UInteger
Public fdwStoreFlags As UInteger
Public hReserved As IntPtr
Public hAttrs As IntPtr
Public hCryptMsg As IntPtr
Public hSorted As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class CRYPTCATSTORE(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("dwPublicVersion", wintypes.DWORD),
("pwszP7File", ctypes.c_void_p),
("hProv", ctypes.c_size_t),
("dwEncodingType", wintypes.DWORD),
("fdwStoreFlags", wintypes.DWORD),
("hReserved", ctypes.c_void_p),
("hAttrs", ctypes.c_void_p),
("hCryptMsg", ctypes.c_void_p),
("hSorted", ctypes.c_void_p),
]#[repr(C)]
pub struct CRYPTCATSTORE {
pub cbStruct: u32,
pub dwPublicVersion: u32,
pub pwszP7File: *mut core::ffi::c_void,
pub hProv: usize,
pub dwEncodingType: u32,
pub fdwStoreFlags: u32,
pub hReserved: *mut core::ffi::c_void,
pub hAttrs: *mut core::ffi::c_void,
pub hCryptMsg: *mut core::ffi::c_void,
pub hSorted: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type CRYPTCATSTORE struct {
cbStruct uint32
dwPublicVersion uint32
pwszP7File uintptr
hProv uintptr
dwEncodingType uint32
fdwStoreFlags uint32
hReserved uintptr
hAttrs uintptr
hCryptMsg uintptr
hSorted uintptr
}type
CRYPTCATSTORE = record
cbStruct: DWORD;
dwPublicVersion: DWORD;
pwszP7File: Pointer;
hProv: NativeUInt;
dwEncodingType: DWORD;
fdwStoreFlags: DWORD;
hReserved: Pointer;
hAttrs: Pointer;
hCryptMsg: Pointer;
hSorted: Pointer;
end;const CRYPTCATSTORE = extern struct {
cbStruct: u32,
dwPublicVersion: u32,
pwszP7File: ?*anyopaque,
hProv: usize,
dwEncodingType: u32,
fdwStoreFlags: u32,
hReserved: ?*anyopaque,
hAttrs: ?*anyopaque,
hCryptMsg: ?*anyopaque,
hSorted: ?*anyopaque,
};type
CRYPTCATSTORE {.bycopy.} = object
cbStruct: uint32
dwPublicVersion: uint32
pwszP7File: pointer
hProv: uint
dwEncodingType: uint32
fdwStoreFlags: uint32
hReserved: pointer
hAttrs: pointer
hCryptMsg: pointer
hSorted: pointerstruct CRYPTCATSTORE
{
uint cbStruct;
uint dwPublicVersion;
void* pwszP7File;
size_t hProv;
uint dwEncodingType;
uint fdwStoreFlags;
void* hReserved;
void* hAttrs;
void* hCryptMsg;
void* hSorted;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CRYPTCATSTORE サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwPublicVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pwszP7File : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hProv : UINT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwEncodingType : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fdwStoreFlags : CRYPTCAT_OPEN_FLAGS (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; hReserved : HANDLE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; hAttrs : HANDLE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; hCryptMsg : void* (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; hSorted : HANDLE (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRYPTCATSTORE サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwPublicVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pwszP7File : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hProv : UINT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwEncodingType : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; fdwStoreFlags : CRYPTCAT_OPEN_FLAGS (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; hReserved : HANDLE (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; hAttrs : HANDLE (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; hCryptMsg : void* (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; hSorted : HANDLE (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CRYPTCATSTORE
#field int cbStruct
#field int dwPublicVersion
#field intptr pwszP7File
#field intptr hProv
#field int dwEncodingType
#field int fdwStoreFlags
#field intptr hReserved
#field intptr hAttrs
#field intptr hCryptMsg
#field intptr hSorted
#endstruct
stdim st, CRYPTCATSTORE ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct