AuthenticationMechanism Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.service.auth.AuthenticationMechanism

public class AuthenticationMechanism

Authentication mechanism, used to store the device symmetric key.

Constructor Summary

Constructor Description
AuthenticationMechanism(AuthenticationType authenticationType)

Constructor that is used for certificate authority authentication.

AuthenticationMechanism(SymmetricKey symmetricKey)

Constructor that saves a symmetric key used for SAS authentication

AuthenticationMechanism(String primaryThumbprint, String secondaryThumbprint)

Constructor that saves a thumbprint used for self signed authentication

Method Summary

Modifier and Type Method and Description
boolean equals(Object other)
AuthenticationType getAuthenticationType()

Getter for authentication type.

java.lang.String getPrimaryThumbprint()

Returns the primary thumbprint

java.lang.String getSecondaryThumbprint()

Returns the secondary thumbprint

SymmetricKey getSymmetricKey()

Getter for symmetric key.

void setAuthenticationType(AuthenticationType type)

Setter for the authentication type of this object

void setPrimaryThumbprint(String primaryThumbprint)

Setter for the primary thumbprint

void setSecondaryThumbprint(String secondaryThumbprint)

Setter for the secondary thumbprint

void setSymmetricKey(SymmetricKey symmetricKey)

Setter for symmetric key.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

AuthenticationMechanism

public AuthenticationMechanism(AuthenticationType authenticationType)

Constructor that is used for certificate authority authentication. Necessary keys will be generated automatically, and can be overwritten later as well.

Parameters:

authenticationType - the type of authentication for this to use.

AuthenticationMechanism

public AuthenticationMechanism(SymmetricKey symmetricKey)

Constructor that saves a symmetric key used for SAS authentication

Parameters:

symmetricKey - the key to use for authentication

Throws:

java.lang.IllegalArgumentException - if the provided symmetricKey is null

AuthenticationMechanism

public AuthenticationMechanism(String primaryThumbprint, String secondaryThumbprint)

Constructor that saves a thumbprint used for self signed authentication

Parameters:

primaryThumbprint - the primary thumbprint to use for authentication
secondaryThumbprint - the secondary thumbprint to use for authentication

Method Details

equals

public boolean equals(Object other)

Overrides:

AuthenticationMechanism.equals(Object other)

Parameters:

other

getAuthenticationType

public AuthenticationType getAuthenticationType()

Getter for authentication type.

Returns:

The authentication type.

getPrimaryThumbprint

public String getPrimaryThumbprint()

Returns the primary thumbprint

Returns:

the primary thumbprint. It may be null

getSecondaryThumbprint

public String getSecondaryThumbprint()

Returns the secondary thumbprint

Returns:

the secondary thumbprint. It may be null

getSymmetricKey

public SymmetricKey getSymmetricKey()

Getter for symmetric key.

Returns:

The symmetric key.

setAuthenticationType

public void setAuthenticationType(AuthenticationType type)

Setter for the authentication type of this object

Parameters:

type - the type of authentication to set

Throws:

java.lang.IllegalArgumentException - if the provided type is null

setPrimaryThumbprint

public void setPrimaryThumbprint(String primaryThumbprint)

Setter for the primary thumbprint

Parameters:

primaryThumbprint - the value to set

setSecondaryThumbprint

public void setSecondaryThumbprint(String secondaryThumbprint)

Setter for the secondary thumbprint

Parameters:

secondaryThumbprint - the value to set

setSymmetricKey

public void setSymmetricKey(SymmetricKey symmetricKey)

Setter for symmetric key.

Parameters:

symmetricKey - the symmetric key to set

Throws:

java.lang.IllegalArgumentException - if the provided symmetricKey is null

Applies to