ホーム › Security.Authentication.WebAuthn › EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | この構造体のバージョン番号を示す。 |
| lKty | INT | 4 | +4 | +4 | COSE鍵タイプ(kty)を示す。 |
| lAlg | INT | 4 | +8 | +8 | COSE署名アルゴリズム識別子(alg)を示す。 |
| lCrv | INT | 4 | +12 | +12 | 楕円曲線の識別子(crv)を示す。 |
| cbX | DWORD | 4 | +16 | +16 | X座標のバイト数を示す。 |
| pbX | BYTE* | 8/4 | +24 | +20 | 公開鍵のX座標バイト列へのポインタ。 |
| cbY | DWORD | 4 | +32 | +24 | Y座標のバイト数を示す。 |
| pbY | BYTE* | 8/4 | +40 | +28 | 公開鍵のY座標バイト列へのポインタ。 |
各言語での定義
#include <windows.h>
// EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY (x64 48 / x86 32 バイト)
typedef struct EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY {
DWORD dwVersion;
INT lKty;
INT lAlg;
INT lCrv;
DWORD cbX;
BYTE* pbX;
DWORD cbY;
BYTE* pbY;
} EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
{
public uint dwVersion;
public int lKty;
public int lAlg;
public int lCrv;
public uint cbX;
public IntPtr pbX;
public uint cbY;
public IntPtr pbY;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
Public dwVersion As UInteger
Public lKty As Integer
Public lAlg As Integer
Public lCrv As Integer
Public cbX As UInteger
Public pbX As IntPtr
Public cbY As UInteger
Public pbY As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("lKty", ctypes.c_int),
("lAlg", ctypes.c_int),
("lCrv", ctypes.c_int),
("cbX", wintypes.DWORD),
("pbX", ctypes.c_void_p),
("cbY", wintypes.DWORD),
("pbY", ctypes.c_void_p),
]#[repr(C)]
pub struct EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY {
pub dwVersion: u32,
pub lKty: i32,
pub lAlg: i32,
pub lCrv: i32,
pub cbX: u32,
pub pbX: *mut core::ffi::c_void,
pub cbY: u32,
pub pbY: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY struct {
dwVersion uint32
lKty int32
lAlg int32
lCrv int32
cbX uint32
pbX uintptr
cbY uint32
pbY uintptr
}type
EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY = record
dwVersion: DWORD;
lKty: Integer;
lAlg: Integer;
lCrv: Integer;
cbX: DWORD;
pbX: Pointer;
cbY: DWORD;
pbY: Pointer;
end;const EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY = extern struct {
dwVersion: u32,
lKty: i32,
lAlg: i32,
lCrv: i32,
cbX: u32,
pbX: ?*anyopaque,
cbY: u32,
pbY: ?*anyopaque,
};type
EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY {.bycopy.} = object
dwVersion: uint32
lKty: int32
lAlg: int32
lCrv: int32
cbX: uint32
pbX: pointer
cbY: uint32
pbY: pointerstruct EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
{
uint dwVersion;
int lKty;
int lAlg;
int lCrv;
uint cbX;
void* pbX;
uint cbY;
void* pbY;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lKty : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lAlg : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lCrv : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbX : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pbX : BYTE* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; cbY : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pbY : BYTE* (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lKty : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lAlg : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lCrv : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbX : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pbX : BYTE* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cbY : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pbY : BYTE* (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY
#field int dwVersion
#field int lKty
#field int lAlg
#field int lCrv
#field int cbX
#field intptr pbX
#field int cbY
#field intptr pbY
#endstruct
stdim st, EXPERIMENTAL_WEBAUTHN_CTAPCBOR_ECC_PUBLIC_KEY ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion