You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-x509-certificate-concepts.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,9 @@ To learn more about the fields that make up an X.509 certificate, see [X.509 cer
122
122
If you're already familiar with X.509 certificates, and you want to generate test versions that you can use to authenticate to your IoT hub, see the following articles:
123
123
124
124
*[Tutorial: Use OpenSSL to create test certificates](tutorial-x509-openssl.md)
125
-
*[Tutorial: Use OpenSSL to create self-signed certificates](tutorial-x509-self-sign.md)
125
+
* If you want to use self-signed certificates for testing, see the [Create a self-signed certificate](reference-x509-certificates.md#create-a-self-signed-certificate) section of [X.509 certificates](reference-x509-certificates.md).
126
+
127
+
>[!IMPORTANT]
128
+
>We recommend that you use certificates signed by an issuing Certificate Authority (CA), even for testing purposes. Never use self-signed certificates in production.
126
129
127
130
If you have a root CA certificate or subordinate CA certificate and you want to upload it to your IoT hub, you must verify that you own that certificate. For more information, see [Tutorial: Upload and verify a CA certificate to IoT Hub](tutorial-x509-prove-possession.md).
X.509 certificates are digital documents that represent a user, computer, service, or device. They're issued by a certification authority (CA), subordinate CA, or registration authority and contain the public key of the certificate subject. They don't contain the subject's private key, which must be stored securely. Public key certificates are documented by [RFC 5280](https://tools.ietf.org/html/rfc5280). They're digitally signed and, in general, contain the following information:
17
+
X.509 certificates are digital documents that represent a user, computer, service, or device. A certificate authority (CA), subordinate CA, or registration authority issues X.509 certificates. The certificates contain the public key of the certificate subject. They don't contain the subject's private key, which must be stored securely. [RFC 5280](https://tools.ietf.org/html/rfc5280) documents public key certificates, including their fields and extensions. Public key certificates are digitally signed and typically contain the following information:
18
18
19
19
* Information about the certificate subject
20
20
* The public key that corresponds to the subject's private key
@@ -42,7 +42,7 @@ The following table describes Version 1 certificate fields for X.509 certificate
42
42
|[Serial Number](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.2)| An integer that represents the unique number for each certificate issued by a certificate authority (CA). |
43
43
|[Signature](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.3)| The identifier for the cryptographic algorithm used by the CA to sign the certificate. The value includes both the identifier of the algorithm and any optional parameters used by that algorithm, if applicable. |
44
44
|[Issuer](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.4)| The distinguished name (DN) of the certificate's issuing CA. |
45
-
|[Validity](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.5)| The inclusive time period for which the certificate is considered valid. |
45
+
|[Validity](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.5)| The inclusive time period for which the certificate is valid. |
46
46
|[Subject](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.6)| The distinguished name (DN) of the certificate subject. |
47
47
|[Subject Public Key Info](https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.7)| The public key owned by the certificate subject. |
48
48
@@ -69,7 +69,7 @@ Certificate extensions, introduced with Version 3, provide methods for associati
69
69
70
70
### Standard extensions
71
71
72
-
The extensions included in this section are defined as part of the X.509 standard, for use in the Internet public key infrastructure (PKI).
72
+
The X.509 standard defines the extensions included in this section, for use in the Internet public key infrastructure (PKI).
73
73
74
74
| Name | Description |
75
75
| --- | --- |
@@ -108,9 +108,84 @@ Certificates can be saved in various formats. Azure IoT Hub authentication typic
108
108
| Binary certificate | A raw form binary certificate using Distinguished Encoding Rules (DER) ASN.1 encoding. |
109
109
| ASCII PEM format | A PEM certificate (.pem) file contains a Base64-encoded certificate beginning with `-----BEGIN CERTIFICATE-----` and ending with `-----END CERTIFICATE-----`. One of the most common formats for X.509 certificates, PEM format is required by IoT Hub when uploading certain certificates, such as device certificates. |
110
110
| ASCII PEM key | Contains a Base64-encoded DER key, optionally with more metadata about the algorithm used for password protection. |
111
-
| PKCS #7 certificate | A format designed for the transport of signed or encrypted data. It can include the entire certificate chain. It's defined by [RFC 2315](https://tools.ietf.org/html/rfc2315). |
112
-
| PKCS #8 key | The format for a private key store. It's defined by [RFC 5208](https://tools.ietf.org/html/rfc5208). |
113
-
| PKCS #12 key and certificate | A complex format that can store and protect a key and the entire certificate chain. It's commonly used with a .p12 or .pfx extension. PKCS #12 is synonymous with the PFX format. It's defined by [RFC 7292](https://tools.ietf.org/html/rfc7292). |
111
+
| PKCS #7 certificate | A format designed for the transport of signed or encrypted data. It can include the entire certificate chain. [RFC 2315](https://tools.ietf.org/html/rfc2315) defines this format. |
112
+
| PKCS #8 key | The format for a private key store. [RFC 5208](https://tools.ietf.org/html/rfc5208) defines this format. |
113
+
| PKCS #12 key and certificate | A complex format that can store and protect a key and the entire certificate chain. It's commonly used with a .p12 or .pfx extension. PKCS #12 is synonymous with the PFX format. [RFC 7292](https://tools.ietf.org/html/rfc7292) defines this format. |
114
+
115
+
## Self-signed certificates
116
+
117
+
You can authenticate a device to your IoT hub for testing purposes by using two self-signed certificates. This type of authentication is sometimes called *thumbprint authentication* because the certificates are identified by calculated hash values called *fingerprints* or *thumbprints*. These calculated hash values are used by IoT Hub to authenticate your devices.
118
+
119
+
>[!IMPORTANT]
120
+
>We recommend that you use certificates signed by an issuing Certificate Authority (CA), even for testing purposes. Never use self-signed certificates in production.
121
+
122
+
### Create a self-signed certificate
123
+
124
+
You can use [OpenSSL](https://www.openssl.org/) to create self-signed certificates. The following steps show you how to run OpenSSL commands in a bash shell to create a self-signed certificate and retrieve a certificate fingerprint that can be used for authenticating your device in IoT Hub.
125
+
126
+
>[!NOTE]
127
+
>If you want to use self-signed certificates for testing, you must create two certificates for each device.
128
+
129
+
1. Run the following command to generate a private key and create a PEM-encoded private key (.key) file, replacing the following placeholders with their corresponding values. The private key generated by the following command uses the RSA algorithm with 2048-bit encryption.
1. Run the following command to generate a PKCS #10 certificate signing request (CSR) and create a CSR (.csr) file, replacing the following placeholders with their corresponding values. Make sure that you specify the device ID of the IoT device for your self-signed certificate when prompted.
138
+
139
+
*{KeyFile}*. The name of your private key file.
140
+
141
+
*{CsrFile}*. The name of your CSR file.
142
+
143
+
*{DeviceID}*. The name of your IoT device.
144
+
145
+
```bash
146
+
openssl req -new -key {KeyFile} -out {CsrFile}
147
+
148
+
Country Name (2 letter code) [XX]:.
149
+
State or Province Name (full name) []:.
150
+
Locality Name (eg, city) [Default City]:.
151
+
Organization Name (eg, company) [Default Company Ltd]:.
152
+
Organizational Unit Name (eg, section) []:.
153
+
Common Name (eg, your name or your server hostname) []:{DeviceID}
154
+
Email Address []:.
155
+
156
+
Please enter the following 'extra' attributes
157
+
to be sent with your certificate request
158
+
A challenge password []:.
159
+
An optional company name []:.
160
+
```
161
+
162
+
1. Run the following command to examine and verify your CSR, replacing the following placeholders with their corresponding values.
163
+
164
+
*{CsrFile}*. The name of your certificate file.
165
+
166
+
```bash
167
+
openssl req -text -in {CsrFile} -verify -noout
168
+
```
169
+
170
+
1. Run the following command to generate a self-signed certificate and create a PEM-encoded certificate (.crt) file, replacing the following placeholders with their corresponding values. The command converts and signs your CSR with your private key, generating a self-signed certificate that expires in 365 days.
1. Run the following command to retrieve the fingerprint of the certificate, replacing the following placeholders with their corresponding values. The fingerprint of a certificate is a calculated hash value that is unique to that certificate. You need the fingerprint to configure your IoT device in IoT Hub for testing.
Copy file name to clipboardExpand all lines: articles/iot-hub/tutorial-x509-introduction.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,6 @@ Before starting any of the articles in this tutorial, you should be familiar wit
37
37
38
38
## X.509 certificate scenario paths
39
39
40
-
Using a self-signed certificate to authenticate a device provides a quick and easy way to test IoT Hub features. Self-signed certificates shouldn't be used in production as they provide less security than a certificate chain anchored with a CA-signed certificate backed by a PKI. To learn more about creating and using a self-signed X.509 certificate to authenticate with IoT Hub, see [Tutorial: Use OpenSSL to create self-signed certificates](tutorial-x509-self-sign.md).
41
-
42
40
Using a CA-signed certificate chain backed by a PKI to authenticate a device provides the best level of security for your devices:
43
41
44
42
- In production, we recommend you get your X.509 CA certificates from a public root certificate authority. Purchasing a CA certificate has the benefit of the root CA acting as a trusted third party to vouch for the legitimacy of your devices. If you already have an X.509 CA certificate, and you know how to create and sign device certificates into a certificate chain, follow the instructions in [Tutorial: Upload and verify a CA certificate to IoT Hub](/tutorial-x509-prove-possession.md) to upload your CA certificate to your IoT hub. Then, follow the instructions in [Tutorial: Test certificate authentication](tutorial-x509-test-certificate.md) to authenticate a device with your IoT hub.
@@ -52,6 +50,9 @@ To learn more about the fields that make up an X.509 certificate, see [X.509 cer
52
50
If you're already familiar with X.509 certificates, and you want to generate test versions that you can use to authenticate to your IoT hub, see the following articles:
53
51
54
52
*[Tutorial: Use OpenSSL to create test certificates](tutorial-x509-openssl.md)
55
-
*[Tutorial: Use OpenSSL to create self-signed certificates](tutorial-x509-self-sign.md)
53
+
* If you want to use self-signed certificates for testing, see the [Create a self-signed certificate](reference-x509-certificates.md#create-a-self-signed-certificate) section of [X.509 certificates](reference-x509-certificates.md).
54
+
55
+
>[!IMPORTANT]
56
+
>We recommend that you use certificates signed by an issuing Certificate Authority (CA), even for testing purposes. Never use self-signed certificates in production.
56
57
57
58
If you have a root CA certificate or subordinate CA certificate and you want to upload it to your IoT hub, you must verify that you own that certificate. For more information, see [Tutorial: Upload and verify a CA certificate to IoT Hub](tutorial-x509-prove-possession.md).
0 commit comments