Certificates - Generate Verification Code
Generate verification code for proof of possession flow.
Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode?api-version=2023-06-30
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
certificate
|
path | True |
string |
The name of the certificate Regex pattern: |
resource
|
path | True |
string |
The name of the resource group that contains the IoT hub. |
resource
|
path | True |
string |
The name of the IoT hub. |
subscription
|
path | True |
string |
The subscription identifier. |
api-version
|
query | True |
string |
The version of the API. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
If-Match | True |
string |
ETag of the Certificate. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The body contains the certificate. |
|
Other Status Codes |
DefaultErrorResponse |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Certificates_GenerateVerificationCode
Sample request
Sample response
{
"name": "cert",
"properties": {
"verificationCode": "##################################",
"subject": "CN=andbucdevice1",
"expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
"thumbprint": "##############################",
"isVerified": false,
"created": "Thu, 12 Oct 2017 19:23:50 GMT",
"updated": "Thu, 12 Oct 2017 19:26:56 GMT"
}
}
Definitions
Name | Description |
---|---|
Certificate |
The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. |
Certificate |
The X509 Certificate. |
Error |
Error details. |
CertificatePropertiesWithNonce
The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow.
Name | Type | Description |
---|---|---|
certificate |
string |
The certificate content |
created |
string |
The certificate's create date and time. |
expiry |
string |
The certificate's expiration date and time. |
isVerified |
boolean |
Determines whether certificate has been verified. |
subject |
string |
The certificate's subject name. |
thumbprint |
string |
The certificate's thumbprint. |
updated |
string |
The certificate's last update date and time. |
verificationCode |
string |
The certificate's verification code that will be used for proof of possession. |
CertificateWithNonceDescription
The X509 Certificate.
Name | Type | Description |
---|---|---|
etag |
string |
The entity tag. |
id |
string |
The resource identifier. |
name |
string |
The name of the certificate. |
properties |
The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. |
|
type |
string |
The resource type. |
ErrorDetails
Error details.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
string |
The error details. |
httpStatusCode |
string |
The HTTP status code. |
message |
string |
The error message. |