Dps Certificate - Generate Verification Code

Generate verification code for Proof of Possession.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode?api-version=2022-12-12
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode?certificate.name={certificate.name}&certificate.rawBytes={certificate.rawBytes}&certificate.isVerified={certificate.isVerified}&certificate.purpose={certificate.purpose}&certificate.created={certificate.created}&certificate.lastUpdated={certificate.lastUpdated}&certificate.hasPrivateKey={certificate.hasPrivateKey}&certificate.nonce={certificate.nonce}&api-version=2022-12-12

URI Parameters

Name In Required Type Description
certificateName
path True

string

The mandatory logical name of the certificate, that the provisioning service uses to access.

provisioningServiceName
path True

string

Name of provisioning service.

resourceGroupName
path True

string

name of resource group.

subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

The version of the API.

certificate.created
query

string

date-time

Certificate creation time.

certificate.hasPrivateKey
query

boolean

Indicates if the certificate contains private key.

certificate.isVerified
query

boolean

Indicates if the certificate has been verified by owner of the private key.

certificate.lastUpdated
query

string

date-time

Certificate last updated time.

certificate.name
query

string

Common Name for the certificate.

certificate.nonce
query

string

Random number generated to indicate Proof of Possession.

certificate.purpose
query

CertificatePurpose

Description mentioning the purpose of the certificate.

certificate.rawBytes
query

string

byte

Raw data of certificate.

Request Header

Name Required Type Description
If-Match True

string

ETag of the certificate. This is required to update an existing certificate, and ignored while creating a brand new certificate.

Responses

Name Type Description
200 OK

VerificationCodeResponse

Generated verification code for that certificate is returned.

Other Status Codes

ErrorDetails

Default error response.

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

DPSGenerateVerificationCode

Sample request

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService/certificates/cert/generateVerificationCode?certificate.name={certificate.name}&certificate.rawBytes={certificate.rawBytes}&certificate.isVerified={certificate.isVerified}&certificate.purpose={certificate.purpose}&certificate.created={certificate.created}&certificate.lastUpdated={certificate.lastUpdated}&certificate.hasPrivateKey={certificate.hasPrivateKey}&certificate.nonce={certificate.nonce}&api-version=2022-12-12

Sample response

{
  "name": "cert",
  "properties": {
    "verificationCode": "##################################",
    "subject": "CN=andbucdevice1",
    "expiry": "Sat, 31 Dec 2039 23:59:59 GMT",
    "thumbprint": "##############################",
    "certificate": "MA==",
    "isVerified": false,
    "created": "Thu, 12 Oct 2017 19:23:50 GMT",
    "updated": "Thu, 12 Oct 2017 19:26:56 GMT"
  }
}

Definitions

Name Description
CertificatePurpose

Description mentioning the purpose of the certificate.

ErrorDetails

Error details.

Properties
VerificationCodeResponse

Description of the response of the verification code.

CertificatePurpose

Description mentioning the purpose of the certificate.

Name Type Description
clientAuthentication

string

serverAuthentication

string

ErrorDetails

Error details.

Name Type Description
code

integer

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

Properties

Name Type Description
certificate

string

base-64 representation of X509 certificate .cer file or just .pem file content.

created

string

Certificate created time.

expiry

string

Code expiry.

isVerified

boolean

Indicate if the certificate is verified by owner of private key.

subject

string

Certificate subject.

thumbprint

string

Certificate thumbprint.

updated

string

Certificate updated time.

verificationCode

string

Verification code.

VerificationCodeResponse

Description of the response of the verification code.

Name Type Description
etag

string

Request etag.

id

string

The resource identifier.

name

string

Name of certificate.

properties

Properties

type

string

The resource type.