1279 lines
34 KiB
YAML
1279 lines
34 KiB
YAML
openapi: 3.0.3
|
||
info:
|
||
title: CISD TMS Crypto Card Internal API
|
||
version: 1.0.0
|
||
description: |
|
||
PCIe 密码卡(GM/T 0018 + SDFE 扩展)内部 HTTP 接口。
|
||
当前文档覆盖 `CryptoCardInternalController` 已暴露接口,可直接导入 Postman。
|
||
servers:
|
||
- url: http://localhost:8080
|
||
description: Local
|
||
|
||
tags:
|
||
- name: CryptoDevice
|
||
description: 设备状态与基础能力
|
||
- name: CryptoAlgorithm
|
||
description: 摘要/HMAC/对称/MAC
|
||
- name: CryptoFile
|
||
description: 设备文件系统操作
|
||
- name: CryptoKey
|
||
description: KEK、标准密钥对、数字信封、协商
|
||
|
||
security:
|
||
- InternalTokenAuth: []
|
||
|
||
paths:
|
||
/api/v1/device/crypto/device-count:
|
||
get:
|
||
tags: [CryptoDevice]
|
||
summary: 获取设备数量
|
||
operationId: getCryptoDeviceCount
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseDeviceCountResult'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/device-conf:
|
||
get:
|
||
tags: [CryptoDevice]
|
||
summary: 获取设备配置
|
||
operationId: getCryptoDeviceConf
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseDeviceConfResult'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/device-info:
|
||
get:
|
||
tags: [CryptoDevice]
|
||
summary: 获取设备信息
|
||
operationId: getCryptoDeviceInfo
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseDeviceInfoResult'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/random:
|
||
get:
|
||
tags: [CryptoDevice]
|
||
summary: 产生随机数
|
||
operationId: generateCryptoRandom
|
||
parameters:
|
||
- name: length
|
||
in: query
|
||
required: false
|
||
schema:
|
||
type: integer
|
||
minimum: 1
|
||
default: 16
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseRandomData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/self-test:
|
||
post:
|
||
tags: [CryptoDevice]
|
||
summary: 设备自检
|
||
operationId: cryptoDeviceSelfTest
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseSelfTestData'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/hmac:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: HMAC 计算(SDFE_HmacInit/Update/Final)
|
||
operationId: cryptoHmac
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoHmacInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseHmacData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/digest:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: 摘要计算(SDF_HashInit/Update/Final)
|
||
operationId: cryptoDigest
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoDigestInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseDigestData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/encrypt/plain:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: 明文密钥对称加密(SDF_Encrypt)
|
||
operationId: cryptoEncryptPlain
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoSymmetricInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/decrypt/plain:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: 明文密钥对称解密(SDF_Decrypt)
|
||
operationId: cryptoDecryptPlain
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoSymmetricInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/encrypt/kek:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: KEK 包装密钥对称加密
|
||
operationId: cryptoEncryptKek
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoSymmetricKekInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/decrypt/kek:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: KEK 包装密钥对称解密
|
||
operationId: cryptoDecryptKek
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoSymmetricKekInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/mac/plain:
|
||
post:
|
||
tags: [CryptoAlgorithm]
|
||
summary: 明文密钥 MAC 计算(SDF_CalculateMAC)
|
||
operationId: cryptoMacPlain
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoMacInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseMacData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/file/create:
|
||
post:
|
||
tags: [CryptoFile]
|
||
summary: 创建设备文件(SDF_CreateFile)
|
||
operationId: cryptoFileCreate
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoFileCreateInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseVoid'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/file/write:
|
||
post:
|
||
tags: [CryptoFile]
|
||
summary: 写设备文件(SDF_WriteFile)
|
||
operationId: cryptoFileWrite
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoFileWriteInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseVoid'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/file/read:
|
||
post:
|
||
tags: [CryptoFile]
|
||
summary: 读设备文件(SDF_ReadFile)
|
||
operationId: cryptoFileRead
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoFileReadInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/file/delete:
|
||
post:
|
||
tags: [CryptoFile]
|
||
summary: 删除设备文件(SDF_DeleteFile)
|
||
operationId: cryptoFileDelete
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoFileDeleteInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseVoid'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/kek/generate:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: 生成 KEK(SDFE_GenerateKEK)
|
||
operationId: cryptoGenerateKek
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoGenerateKekInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseVoid'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/kek/status:
|
||
get:
|
||
tags: [CryptoKey]
|
||
summary: 查询 KEK 状态(SDFE_StatusKey_KEK)
|
||
operationId: cryptoKekStatus
|
||
parameters:
|
||
- name: keyIndex
|
||
in: query
|
||
required: true
|
||
schema:
|
||
type: integer
|
||
minimum: 0
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseKeyStatusResult'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/lmk/seed-mac:
|
||
get:
|
||
tags: [CryptoKey]
|
||
summary: 导出 LMK Seed MAC(SDFE_ExportLMKSeedMAC)
|
||
operationId: cryptoExportLmkSeedMac
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseLmkSeedMacData'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/lmk/check:
|
||
get:
|
||
tags: [CryptoKey]
|
||
summary: 检查 LMK 是否存在(SDFE_CheckLMK)
|
||
operationId: cryptoCheckLmk
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBoolean'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/std/keypair/rsa:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: 生成标准 RSA 密钥对(SDF_GenerateKeyPair_RSA)
|
||
operationId: cryptoGenerateStandardRsaKeyPair
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoGenerateStandardRsaKeyPairInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseStandardKeyPairData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/std/keypair/ecc:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: 生成标准 ECC 密钥对(SDF_GenerateKeyPair_ECC)
|
||
operationId: cryptoGenerateStandardEccKeyPair
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoGenerateStandardEccKeyPairInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseStandardKeyPairData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/envelope/exchange/rsa:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: RSA 数字信封转换(SDF_ExchangeDigitEnvelopeBaseOnRSA)
|
||
operationId: cryptoExchangeEnvelopeRsa
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoExchangeEnvelopeRsaInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/envelope/exchange/ecc:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: ECC 数字信封转换(SDF_ExchangeDigitEnvelopeBaseOnECC)
|
||
operationId: cryptoExchangeEnvelopeEcc
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoExchangeEnvelopeEccInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseBinaryData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/agreement/data-key/ecc:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: ECC 协商数据并生成会话密钥(SDF_GenerateAgreementDataAndKeyWithECC)
|
||
operationId: cryptoAgreementDataAndKeyEcc
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoGenerateAgreementDataAndKeyEccInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseAgreementDataAndKeyEccData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
/api/v1/device/crypto/agreement/session-key/ecc:
|
||
post:
|
||
tags: [CryptoKey]
|
||
summary: ECC 协商生成会话密钥(SDF_GenerateAgreementDataWithECC + SDF_GenerateKeyWithECC)
|
||
operationId: cryptoAgreementSessionKeyEcc
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CryptoGenerateSessionKeyEccInternalRequest'
|
||
responses:
|
||
'200':
|
||
description: OK
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseEccAgreementSessionKeyData'
|
||
'400':
|
||
$ref: '#/components/responses/BadRequest'
|
||
'500':
|
||
$ref: '#/components/responses/InternalError'
|
||
|
||
components:
|
||
securitySchemes:
|
||
InternalTokenAuth:
|
||
type: apiKey
|
||
in: header
|
||
name: X-Internal-Token
|
||
|
||
responses:
|
||
BadRequest:
|
||
description: 参数错误
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseError'
|
||
InternalError:
|
||
description: 业务/系统错误(含密码卡调用失败)
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ApiResponseError'
|
||
|
||
schemas:
|
||
ApiResponseBase:
|
||
type: object
|
||
properties:
|
||
success:
|
||
type: boolean
|
||
code:
|
||
type: integer
|
||
msg:
|
||
type: string
|
||
timestamp:
|
||
type: integer
|
||
format: int64
|
||
traceId:
|
||
type: string
|
||
nullable: true
|
||
path:
|
||
type: string
|
||
nullable: true
|
||
required: [success, code, msg, timestamp]
|
||
|
||
ApiResponseVoid:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
type: object
|
||
nullable: true
|
||
|
||
ApiResponseError:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
type: object
|
||
nullable: true
|
||
details:
|
||
type: object
|
||
additionalProperties: true
|
||
nullable: true
|
||
|
||
ApiResponseDeviceCountResult:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/DeviceCountResult'
|
||
|
||
ApiResponseDeviceConfResult:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/DeviceConfResult'
|
||
|
||
ApiResponseDeviceInfoResult:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/DeviceInfoResult'
|
||
|
||
ApiResponseRandomData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/RandomData'
|
||
|
||
ApiResponseSelfTestData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/SelfTestData'
|
||
|
||
ApiResponseHmacData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/HmacData'
|
||
|
||
ApiResponseDigestData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/DigestData'
|
||
|
||
ApiResponseBinaryData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/BinaryData'
|
||
|
||
ApiResponseMacData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/MacData'
|
||
|
||
ApiResponseKeyStatusResult:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/KeyStatusResult'
|
||
|
||
ApiResponseLmkSeedMacData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/LmkSeedMacData'
|
||
|
||
ApiResponseBoolean:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
type: boolean
|
||
|
||
ApiResponseStandardKeyPairData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/StandardKeyPairData'
|
||
|
||
ApiResponseAgreementDataAndKeyEccData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/AgreementDataAndKeyEccData'
|
||
|
||
ApiResponseEccAgreementSessionKeyData:
|
||
allOf:
|
||
- $ref: '#/components/schemas/ApiResponseBase'
|
||
- type: object
|
||
properties:
|
||
data:
|
||
$ref: '#/components/schemas/EccAgreementSessionKeyData'
|
||
|
||
DeviceCountResult:
|
||
type: object
|
||
properties:
|
||
deviceNumber:
|
||
type: integer
|
||
normalDeviceNumber:
|
||
type: integer
|
||
|
||
DeviceConfResult:
|
||
type: object
|
||
properties:
|
||
level:
|
||
type: integer
|
||
description: 安全级别
|
||
devCount:
|
||
type: integer
|
||
rsaKeyCount:
|
||
type: integer
|
||
sm2KeyCount:
|
||
type: integer
|
||
kekCount:
|
||
type: integer
|
||
sessKeyCount:
|
||
type: integer
|
||
fileSysCapacity:
|
||
type: integer
|
||
|
||
DeviceInfoResult:
|
||
type: object
|
||
properties:
|
||
issuerName:
|
||
type: string
|
||
deviceName:
|
||
type: string
|
||
deviceSerial:
|
||
type: string
|
||
deviceVersion:
|
||
type: integer
|
||
standardVersion:
|
||
type: integer
|
||
asymAlgAbility0:
|
||
type: integer
|
||
asymAlgAbility1:
|
||
type: integer
|
||
symAlgAbility:
|
||
type: integer
|
||
hashAlgAbility:
|
||
type: integer
|
||
bufferSize:
|
||
type: integer
|
||
|
||
KeyStatusResult:
|
||
type: object
|
||
properties:
|
||
keyState:
|
||
type: integer
|
||
description: 0=NO_VALID, 1=NO_RIGHT, 2=RIGHT, -1=UNKNOWN
|
||
keyStateName:
|
||
type: string
|
||
|
||
RandomData:
|
||
type: object
|
||
properties:
|
||
length:
|
||
type: integer
|
||
randomBase64:
|
||
type: string
|
||
required: [length, randomBase64]
|
||
|
||
SelfTestData:
|
||
type: object
|
||
properties:
|
||
passed:
|
||
type: boolean
|
||
required: [passed]
|
||
|
||
BinaryData:
|
||
type: object
|
||
properties:
|
||
length:
|
||
type: integer
|
||
dataBase64:
|
||
type: string
|
||
required: [length, dataBase64]
|
||
|
||
HmacData:
|
||
type: object
|
||
properties:
|
||
hmacLength:
|
||
type: integer
|
||
hmacBase64:
|
||
type: string
|
||
required: [hmacLength, hmacBase64]
|
||
|
||
DigestData:
|
||
type: object
|
||
properties:
|
||
digestLength:
|
||
type: integer
|
||
digestBase64:
|
||
type: string
|
||
required: [digestLength, digestBase64]
|
||
|
||
MacData:
|
||
type: object
|
||
properties:
|
||
length:
|
||
type: integer
|
||
macBase64:
|
||
type: string
|
||
required: [length, macBase64]
|
||
|
||
LmkSeedMacData:
|
||
type: object
|
||
properties:
|
||
length:
|
||
type: integer
|
||
macBase64:
|
||
type: string
|
||
required: [length, macBase64]
|
||
|
||
StandardKeyPairData:
|
||
type: object
|
||
properties:
|
||
publicKeyLength:
|
||
type: integer
|
||
publicKeyBase64:
|
||
type: string
|
||
privateKeyLength:
|
||
type: integer
|
||
privateKeyBase64:
|
||
type: string
|
||
required: [publicKeyLength, publicKeyBase64, privateKeyLength, privateKeyBase64]
|
||
|
||
AgreementDataAndKeyEccData:
|
||
type: object
|
||
properties:
|
||
responsePublicKeyLength:
|
||
type: integer
|
||
responsePublicKeyBase64:
|
||
type: string
|
||
responseTmpPublicKeyLength:
|
||
type: integer
|
||
responseTmpPublicKeyBase64:
|
||
type: string
|
||
sessionKeyGenerated:
|
||
type: boolean
|
||
required:
|
||
[responsePublicKeyLength, responsePublicKeyBase64, responseTmpPublicKeyLength, responseTmpPublicKeyBase64, sessionKeyGenerated]
|
||
|
||
EccAgreementSessionKeyData:
|
||
type: object
|
||
properties:
|
||
sponsorPublicKeyLength:
|
||
type: integer
|
||
sponsorPublicKeyBase64:
|
||
type: string
|
||
sponsorTmpPublicKeyLength:
|
||
type: integer
|
||
sponsorTmpPublicKeyBase64:
|
||
type: string
|
||
sessionKeyLength:
|
||
type: integer
|
||
sessionKeyBase64:
|
||
type: string
|
||
sessionKeyGenerated:
|
||
type: boolean
|
||
required:
|
||
[sponsorPublicKeyLength, sponsorPublicKeyBase64, sponsorTmpPublicKeyLength, sponsorTmpPublicKeyBase64, sessionKeyLength, sessionKeyBase64, sessionKeyGenerated]
|
||
|
||
CryptoHmacInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
description: 算法标识,如 SM3=1
|
||
keyBase64:
|
||
type: string
|
||
dataBase64:
|
||
type: string
|
||
required: [algId, keyBase64, dataBase64]
|
||
example:
|
||
algId: 1
|
||
keyBase64: AQIDBAUGBwgJCgsMDQ4PEA==
|
||
dataBase64: aGVsbG8tdG1z
|
||
|
||
CryptoDigestInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
dataBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
default: 64
|
||
required: [algId, dataBase64]
|
||
example:
|
||
algId: 1
|
||
dataBase64: dGVzdC1kaWdlc3Q=
|
||
outBufferSize: 64
|
||
|
||
CryptoSymmetricInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
description: 如 SM4_ECB=1025, SM4_CBC=1026
|
||
keyBase64:
|
||
type: string
|
||
ivBase64:
|
||
type: string
|
||
nullable: true
|
||
dataBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [algId, keyBase64, dataBase64, outBufferSize]
|
||
example:
|
||
algId: 1026
|
||
keyBase64: MDEyMzQ1Njc4OUFCQ0RFRg==
|
||
ivBase64: MDEyMzQ1Njc4OUFCQ0RFRg==
|
||
dataBase64: cGxhaW4tdGV4dA==
|
||
outBufferSize: 1024
|
||
|
||
CryptoSymmetricKekInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
kekIndex:
|
||
type: integer
|
||
minimum: 0
|
||
wrappedKeyBase64:
|
||
type: string
|
||
ivBase64:
|
||
type: string
|
||
nullable: true
|
||
dataBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [algId, kekIndex, wrappedKeyBase64, dataBase64, outBufferSize]
|
||
example:
|
||
algId: 1026
|
||
kekIndex: 1
|
||
wrappedKeyBase64: AQIDBAUGBwg=
|
||
ivBase64: MDEyMzQ1Njc4OUFCQ0RFRg==
|
||
dataBase64: c2VjcmV0LWRhdGE=
|
||
outBufferSize: 1024
|
||
|
||
CryptoMacInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
description: 如 SM4_MAC=1040
|
||
keyBase64:
|
||
type: string
|
||
ivBase64:
|
||
type: string
|
||
nullable: true
|
||
dataBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
default: 32
|
||
required: [algId, keyBase64, dataBase64]
|
||
example:
|
||
algId: 1040
|
||
keyBase64: MDEyMzQ1Njc4OUFCQ0RFRg==
|
||
ivBase64: MDEyMzQ1Njc4OUFCQ0RFRg==
|
||
dataBase64: bWFjLWRhdGE=
|
||
outBufferSize: 32
|
||
|
||
CryptoFileCreateInternalRequest:
|
||
type: object
|
||
properties:
|
||
fileName:
|
||
type: string
|
||
fileSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [fileName, fileSize]
|
||
example:
|
||
fileName: TEST01
|
||
fileSize: 2048
|
||
|
||
CryptoFileWriteInternalRequest:
|
||
type: object
|
||
properties:
|
||
fileName:
|
||
type: string
|
||
offset:
|
||
type: integer
|
||
minimum: 0
|
||
dataBase64:
|
||
type: string
|
||
required: [fileName, offset, dataBase64]
|
||
example:
|
||
fileName: TEST01
|
||
offset: 0
|
||
dataBase64: SGVsbG8sQ1JZUFRP
|
||
|
||
CryptoFileReadInternalRequest:
|
||
type: object
|
||
properties:
|
||
fileName:
|
||
type: string
|
||
offset:
|
||
type: integer
|
||
minimum: 0
|
||
readLength:
|
||
type: integer
|
||
minimum: 1
|
||
required: [fileName, offset, readLength]
|
||
example:
|
||
fileName: TEST01
|
||
offset: 0
|
||
readLength: 64
|
||
|
||
CryptoFileDeleteInternalRequest:
|
||
type: object
|
||
properties:
|
||
fileName:
|
||
type: string
|
||
required: [fileName]
|
||
example:
|
||
fileName: TEST01
|
||
|
||
CryptoGenerateKekInternalRequest:
|
||
type: object
|
||
properties:
|
||
keyBits:
|
||
type: integer
|
||
minimum: 1
|
||
keyIndex:
|
||
type: integer
|
||
minimum: 0
|
||
required: [keyBits, keyIndex]
|
||
example:
|
||
keyBits: 128
|
||
keyIndex: 1
|
||
|
||
CryptoGenerateStandardRsaKeyPairInternalRequest:
|
||
type: object
|
||
properties:
|
||
keyBits:
|
||
type: integer
|
||
minimum: 1
|
||
publicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
privateKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [keyBits, publicKeyBufferSize, privateKeyBufferSize]
|
||
example:
|
||
keyBits: 2048
|
||
publicKeyBufferSize: 1024
|
||
privateKeyBufferSize: 4096
|
||
|
||
CryptoGenerateStandardEccKeyPairInternalRequest:
|
||
type: object
|
||
properties:
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
keyBits:
|
||
type: integer
|
||
minimum: 1
|
||
publicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
privateKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [algId, keyBits, publicKeyBufferSize, privateKeyBufferSize]
|
||
example:
|
||
algId: 132096
|
||
keyBits: 256
|
||
publicKeyBufferSize: 256
|
||
privateKeyBufferSize: 256
|
||
|
||
CryptoExchangeEnvelopeRsaInternalRequest:
|
||
type: object
|
||
properties:
|
||
keyIndex:
|
||
type: integer
|
||
minimum: 0
|
||
publicKeyBase64:
|
||
type: string
|
||
inputEnvelopeBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [keyIndex, publicKeyBase64, inputEnvelopeBase64, outBufferSize]
|
||
example:
|
||
keyIndex: 1
|
||
publicKeyBase64: AQIDBAUG
|
||
inputEnvelopeBase64: BwgJCgsM
|
||
outBufferSize: 1024
|
||
|
||
CryptoExchangeEnvelopeEccInternalRequest:
|
||
type: object
|
||
properties:
|
||
keyIndex:
|
||
type: integer
|
||
minimum: 0
|
||
algId:
|
||
type: integer
|
||
minimum: 1
|
||
publicKeyBase64:
|
||
type: string
|
||
inputEnvelopeBase64:
|
||
type: string
|
||
outBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required: [keyIndex, algId, publicKeyBase64, inputEnvelopeBase64, outBufferSize]
|
||
example:
|
||
keyIndex: 1
|
||
algId: 132096
|
||
publicKeyBase64: AQIDBAUG
|
||
inputEnvelopeBase64: BwgJCgsM
|
||
outBufferSize: 1024
|
||
|
||
CryptoGenerateAgreementDataAndKeyEccInternalRequest:
|
||
type: object
|
||
properties:
|
||
iskIndex:
|
||
type: integer
|
||
minimum: 0
|
||
keyBits:
|
||
type: integer
|
||
minimum: 1
|
||
responseIdBase64:
|
||
type: string
|
||
sponsorIdBase64:
|
||
type: string
|
||
sponsorPublicKeyBase64:
|
||
type: string
|
||
sponsorTmpPublicKeyBase64:
|
||
type: string
|
||
responsePublicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
responseTmpPublicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required:
|
||
[iskIndex, keyBits, responseIdBase64, sponsorIdBase64, sponsorPublicKeyBase64, sponsorTmpPublicKeyBase64, responsePublicKeyBufferSize, responseTmpPublicKeyBufferSize]
|
||
example:
|
||
iskIndex: 1
|
||
keyBits: 128
|
||
responseIdBase64: AQID
|
||
sponsorIdBase64: BAUG
|
||
sponsorPublicKeyBase64: BwgJCg==
|
||
sponsorTmpPublicKeyBase64: CwwNDg==
|
||
responsePublicKeyBufferSize: 256
|
||
responseTmpPublicKeyBufferSize: 256
|
||
|
||
CryptoGenerateSessionKeyEccInternalRequest:
|
||
type: object
|
||
properties:
|
||
iskIndex:
|
||
type: integer
|
||
minimum: 0
|
||
keyBits:
|
||
type: integer
|
||
minimum: 1
|
||
sponsorIdBase64:
|
||
type: string
|
||
responseIdBase64:
|
||
type: string
|
||
responsePublicKeyBase64:
|
||
type: string
|
||
responseTmpPublicKeyBase64:
|
||
type: string
|
||
sponsorPublicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
sponsorTmpPublicKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
sessionKeyBufferSize:
|
||
type: integer
|
||
minimum: 1
|
||
required:
|
||
[iskIndex, keyBits, sponsorIdBase64, responseIdBase64, responsePublicKeyBase64, responseTmpPublicKeyBase64, sponsorPublicKeyBufferSize, sponsorTmpPublicKeyBufferSize, sessionKeyBufferSize]
|
||
example:
|
||
iskIndex: 1
|
||
keyBits: 128
|
||
sponsorIdBase64: AQID
|
||
responseIdBase64: BAUG
|
||
responsePublicKeyBase64: BwgJCg==
|
||
responseTmpPublicKeyBase64: CwwNDg==
|
||
sponsorPublicKeyBufferSize: 256
|
||
sponsorTmpPublicKeyBufferSize: 256
|
||
sessionKeyBufferSize: 64
|