X509Attestation Class

  • java.lang.Object
    • Attestation
      • com.microsoft.azure.sdk.iot.provisioning.service.configs.X509Attestation

public class X509Attestation extends Attestation,Serializable

Representation of a single Device Provisioning Service X509 Attestation.

The provisioning service supports Device Identifier Composition Engine, or DICE, as the device attestation mechanism. To use DICE, user must provide the X509 certificate. This class provide the means to create a new attestation for a X509 certificate and return it as an abstract interface Attestation.

An X509 attestation can contains one of the 3 types of certificate:

<varlistentry>

  <b>Client or Alias certificate:</b>

</varlistentry>

<li>

  <p>Called on this class as clientCertificates, this certificate can authenticate a single device. </p>

</li>

<varlistentry>

  <b>Signing or Root certificate:</b>

</varlistentry>

<li>

  <p>Called on this class as rootCertificates, this certificate can create multiple Client certificates to authenticate multiple devices. </p>

</li>

<varlistentry>

  <b>CA Reference:</b>

</varlistentry>

<li>

  <p>Called on this class as X509CAReferences, this is a CA reference for a rootCertificate that can create multiple Client certificates to authenticate multiple devices. </p>

</li>

The provisioning service allows user to create IndividualEnrollment and EnrollmentGroup. For all operations over IndividualEnrollment with DICE, user must provide a clientCertificates, and for operations over EnrollmentGroup, user must provide a rootCertificates or a X509CAReferences.

For each of this types of certificates, user can provide 2 Certificates, a primary and a secondary. Only the primary is mandatory, the secondary is optional.

The provisioning service will process the provided certificates, but will never return it back. Instead of it, getPrimaryX509CertificateInfo() and getSecondaryX509CertificateInfo() will return the certificate information for the certificates.

Constructor Summary

Constructor Description
X509Attestation(X509Attestation x509Attestation)

Constructor [COPY]

Creates a new instance of the X509Attestation copping the content of the provided one.

Method Summary

Modifier and Type Method and Description
X509Attestation createFromCAReferences(String primary)

Factory with CAReferences with only primary reference.

Creates a new instance of the X509Attestation using the provided primary CA reference.

X509Attestation createFromCAReferences(String primary, String secondary)

Factory with CAReferences with primary and secondary references.

Creates a new instance of the X509Attestation with the primary and secondary CA references.

X509Attestation createFromClientCertificates(String primary)

Factory with ClientCertificate with only primary certificate.

Creates a new instance of the X509Attestation using the provided primary Certificate.

X509Attestation createFromClientCertificates(String primary, String secondary)

Factory with ClientCertificates with primary and secondary certificates.

Creates a new instance of the X509Attestation with the primary and secondary certificates.

X509Attestation createFromRootCertificates(String primary)

Factory with RootCertificates with only primary certificate.

Creates a new instance of the X509Attestation using the provided primary Certificate.

X509Attestation createFromRootCertificates(String primary, String secondary)

Factory with RootCertificates with primary and secondary certificates.

Creates a new instance of the X509Attestation with the primary and secondary certificates.

final X509CAReferences getCAReferences()

Getter for the caReferences.

final X509Certificates getClientCertificates()

Getter for the clientCertificates.

X509CertificateInfo getPrimaryX509CertificateInfo()

Getter for the primary X509 certificate info.

This method is a getter for the information returned from the provisioning service for the provided primary certificate.

final X509Certificates getRootCertificates()

Getter for the rootCertificates.

X509CertificateInfo getSecondaryX509CertificateInfo()

Getter for the secondary X509 certificate info.

This method is a getter for the information returned from the provisioning service for the provided secondary certificate.

Inherited Members

Constructor Details

X509Attestation

public X509Attestation(X509Attestation x509Attestation)

Constructor [COPY]

Creates a new instance of the X509Attestation copping the content of the provided one.

Parameters:

x509Attestation - the original X509Attestation to copy.

Throws:

IllegalArgumentException - if the provided x509Attestation is null or do not contains a primary certificate.

Method Details

createFromCAReferences

public static X509Attestation createFromCAReferences(String primary)

Factory with CAReferences with only primary reference.

Creates a new instance of the X509Attestation using the provided primary CA reference.

Parameters:

primary -

theString 

</code> with the primary CA reference. It cannot be<code>null 

</code> or empty. </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide CA reference is invalid.

createFromCAReferences

public static X509Attestation createFromCAReferences(String primary, String secondary)

Factory with CAReferences with primary and secondary references.

Creates a new instance of the X509Attestation with the primary and secondary CA references.

Parameters:

primary -

theString 

</code> with the primary CA references. It cannot be<code>null 

</code> or empty. </p>
secondary -

theString 

</code> with the secondary CA references. It can be<code>null 

</code> or empty (ignored). </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide primary CA reference is invalid.

createFromClientCertificates

public static X509Attestation createFromClientCertificates(String primary)

Factory with ClientCertificate with only primary certificate.

Creates a new instance of the X509Attestation using the provided primary Certificate.

Parameters:

primary -

theString 

</code> with the primary certificate. It cannot be<code>null 

</code> or empty. </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide certificate is invalid.

createFromClientCertificates

public static X509Attestation createFromClientCertificates(String primary, String secondary)

Factory with ClientCertificates with primary and secondary certificates.

Creates a new instance of the X509Attestation with the primary and secondary certificates.

Parameters:

primary -

theString 

</code> with the primary certificate. It cannot be<code>null 

</code> or empty. </p>
secondary -

theString 

</code> with the secondary certificate. It can be<code>null 

</code> or empty (ignored). </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide primary certificate is invalid.

createFromRootCertificates

public static X509Attestation createFromRootCertificates(String primary)

Factory with RootCertificates with only primary certificate.

Creates a new instance of the X509Attestation using the provided primary Certificate.

Parameters:

primary -

theString 

</code> with the primary certificate. It cannot be<code>null 

</code> or empty. </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide certificate is invalid.

createFromRootCertificates

public static X509Attestation createFromRootCertificates(String primary, String secondary)

Factory with RootCertificates with primary and secondary certificates.

Creates a new instance of the X509Attestation with the primary and secondary certificates.

Parameters:

primary -

theString 

</code> with the primary certificate. It cannot be<code>null 

</code> or empty. </p>
secondary -

theString 

</code> with the secondary certificate. It can be<code>null 

</code> or empty (ignored). </p>

Returns:

the new instance of the X509Attestation.

Throws:

IllegalArgumentException - if the provide primary certificate is invalid.

getCAReferences

public final X509CAReferences getCAReferences()

Getter for the caReferences.

Returns:

the X509CAReferences with the stored caReferences. it can benull 

</code> . </p>

getClientCertificates

public final X509Certificates getClientCertificates()

Getter for the clientCertificates.

Returns:

the X509Certificates with the stored clientCertificates. it can benull 

</code> . </p>

getPrimaryX509CertificateInfo

public X509CertificateInfo getPrimaryX509CertificateInfo()

Getter for the primary X509 certificate info.

This method is a getter for the information returned from the provisioning service for the provided primary certificate.

Returns:

the X509CertificateInfo with the returned certificate information. it can benull 

</code> . </p>

getRootCertificates

public final X509Certificates getRootCertificates()

Getter for the rootCertificates.

Returns:

the X509Certificates with the stored rootCertificates. it can benull 

</code> . </p>

getSecondaryX509CertificateInfo

public X509CertificateInfo getSecondaryX509CertificateInfo()

Getter for the secondary X509 certificate info.

This method is a getter for the information returned from the provisioning service for the provided secondary certificate.

Returns:

the X509CertificateInfo with the returned certificate information. it can benull 

</code> . </p>

Applies to