public class X509Certificates extends Object
this class creates a representation of an X509 certificate. It can receive primary and secondary certificate, but only the primary is mandatory.
Users must provide the certificate as a String, from a .pem files.
This class will encapsulate both in a single X509Attestation. The following JSON is an example
of the result of this class.
{
"primary": {
"certificate": "-----BEGIN CERTIFICATE-----\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"-----END CERTIFICATE-----\n"
},
"secondary": {
"certificate": "-----BEGIN CERTIFICATE-----\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"-----END CERTIFICATE-----\n"
}
}
After send an X509 certificate with success, the provisioning service will return the X509CertificateInfo
for both primary and secondary certificate. User can get these info from this class, and once again, only
the primary info is mandatory. The following JSON is an example what info the provisioning service will
return for X509.
{
"primary": {
"info": {
"subjectName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
"sha1Thumbprint": "0000000000000000000000000000000000",
"sha256Thumbprint": "validEnrollmentGroupId",
"issuerName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
"notBeforeUtc": "2017-11-14T12:34:18Z",
"notAfterUtc": "2017-11-20T12:34:18Z",
"serialNumber": "000000000000000000",
"version": 3
}
},
"secondary": {
"info": {
"subjectName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
"sha1Thumbprint": "0000000000000000000000000000000000",
"sha256Thumbprint": "validEnrollmentGroupId",
"issuerName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
"notBeforeUtc": "2017-11-14T12:34:18Z",
"notAfterUtc": "2017-11-20T12:34:18Z",
"serialNumber": "000000000000000000",
"version": 3
}
}
}
| Constructor and Description |
|---|
X509Certificates(X509Certificates x509Certificates)
Constructor [COPY]
|
| Modifier and Type | Method and Description |
|---|---|
X509CertificateWithInfo |
getPrimary()
Deprecated.
as of provisioning-service-client version 1.3.3, please use
getPrimaryFinal() |
X509CertificateWithInfo |
getPrimaryFinal()
Getter for the primary.
|
X509CertificateWithInfo |
getSecondary()
Deprecated.
as of provisioning-service-client version 1.3.3, please use
getSecondaryFinal() |
X509CertificateWithInfo |
getSecondaryFinal()
Getter for the secondary.
|
public X509Certificates(X509Certificates x509Certificates)
Creates a new instance of the x509Certificates copping the content of the provided one.
x509Certificates - the original X509Certificates to copy.IllegalArgumentException - if the provided x509Certificates is null or if its primary certificate is null.@Deprecated public X509CertificateWithInfo getPrimary()
getPrimaryFinal()X509CertificateWithInfo with the stored primary. It cannot be null.public final X509CertificateWithInfo getPrimaryFinal()
X509CertificateWithInfo with the stored primary. It cannot be null.@Deprecated public X509CertificateWithInfo getSecondary()
getSecondaryFinal()X509CertificateWithInfo with the stored secondary. It can be null.public final X509CertificateWithInfo getSecondaryFinal()
X509CertificateWithInfo with the stored secondary. It can be null.Copyright © 2021. All rights reserved.