Rate This Document
Findability
Accuracy
Completeness
Readability

Generating a CSR

Generates a CSR.

Item

Description

API path

/rest/kdc_agent/v1/proxy

Request method

POST

Request Header

Parameter

Value

Content-Type

application/json

Accept

application/json

Request Body

Parameter

Type

Specification

Required (Yes/No)

Description

taskId

String

64

Yes

Task ID. Each request must use a unique ID.

version

String

8

Yes

Payload format version in VR format, initially set to 26.0.

msgType

Int

32

Yes

Service message type, with a value of 0x0021.

data

Object

-

Yes

Service message entity in key:value format.

data.subject

Object

-

Yes

Subject information

data.subject.commonName

String

64

Yes

Device identity (such as SN or traceability code), used to bind the device to the certificate.

data.subject.country

String

2

Yes

Two-letter ISO country code, for example, "CN".

data.subject.state

String

128

No

State/Province name.

data.subject.locality

String

128

No

City/Region name.

data.subject.organization

String

64

Yes

Organization name (such as a company name).

data.subject.organizationalUnit

String

64

No

Organization unit name (such as a department name).

data.keyPair

Object

-

Yes

Key pair configuration.

data.subject.algorithm

String

16

Yes

Key algorithm type. Supported value: RSA4096 or ECC256.

data.subject.padding

String

16

No

Padding scheme (applicable to RSA only). Default value: PSS. Other padding schemes are not supported currently.

data.subject.hashAlgorithm

String

16

No

Hash algorithm. Default value: SHA256. Other options include SHA384 and SHA512.

data.extensions

Object

-

No

Extension fields.

data.extensions.keyUsage

String

256

No

Key usage. A comma-separated list of usages, such as digitalSignature,keyEncipherment.

Request Body Example

{
"taskId": "SDFMOASDMNFIOASMD",
"version": "26.0",
"msgType": "0x0021",
"data": {
{
"subject": {
"commonName": "SN1234567890",
"country": "CN",
"state": "Guangdong",
"locality": "Dongguan",
"organization": "AAA",
"organizationalUnit": "IT"
},
"keyPair": {
"algorithm": "ECC256",
"hashAlgorithm": "SHA256"
},
"extensions": {
"keyUsage": "digitalSignature"
}
}
}

Response Header

Parameter

Value

Content-Type

application/json

Response Body

Parameter

Type

Specification

Required (Yes/No)

Description

retCode

Int

32

Yes

Error code

retMsg

String

64

Yes

Error message

data

Object

-

Yes

Custom service data

data.csr

String

4096

No

Base64-encoded CSR packet.

Response Body Example

{
"retCode": 0,
"retMsg": "Success",
"data": {
"csr: "-----BEGIN CERTIFICATE REQUEST-----
MIIC3DCCAcQCAQAwbTELMAkGA1UEBhMCQ04xDDAKBgNVBAgMA3F4dzEQMA4GA1UE
BwwHYmVpamluZzELMAkGA1UECgwCSFcxDjAMBgNVBAsMBUhpc2VjMQswCQYDVQQD
DAJhYTEUMBIGCSqGSIb3DQEJARYFZGtqZmswggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDiiccmevUdNyvIC+xqt/AZfd4cBt9pECXkULAC2vOiD1p9q43A
ToFx0a2SQQa4ZoZwtz4wT6wUKJhApcFZAFzhkmZcsG9FcWZp9gw6s+oE6Wv6/O1U
RF2+HdVzWfWU/RDKWUHwegzGLYR9JwPlhegBMzONNO371aE5VZEVxiBlornI/RVv
aqFBgkSDegQlhuy5FPF/2iIUqOkLiBW2yNLKcJpjRRo98RQtCIDca3FCa/YRQnv9
YYnUAAy1uYopY9x+PGvj2+m1MA0rPynRwcF+FzVGJpfWlsfPXZznwnOBBf3xeXDx
bYAExFstw8oVIIBKa7WnpjCCH89tAw96NDqLAgMBAAGgKjATBgkqhkiG9w0BCQIx
BgwEenhjdjATBgkqhkiG9w0BCQcxBgwEenhjdjANBgkqhkiG9w0BAQsFAAOCAQEA
NglEFnc+zyBi6hbOj02uSmvz8PURX/HnCaSTpR/+7OYlWgvUebd5Eb7sd1UGVdBT
Ee3s3GGzDDuQGUM0Kv9UCDjLJmMRXBTBG/g4PtfnWD98IJxHS2Tn42zpecXLBu2a
723j4tUaB1UjDRwfOoFrIiGCsMvAQR9FFmLADcqeRHyTb+RZJqoNYfsDg9pTKMlt
elLZpSsD4hCmelKHRnG0/9o3z8LCo2SucrY5P5XSINELDgNbZmdGNZ/Kz4GrcGSl
XYsiUV6BU3EFl/fmUKd57i4ju17HHmKCAg0c3c2sCS0AR64iygN9ShXh3uLSbJ0y
65xMmgJRH3wIwH/Eh12xTw==
-----END CERTIFICATE REQUEST-----"
}
}