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. Necessary keys will be generated automatically, and can be overwritten later as well.

AuthenticationMechanism(String primaryThumbprint, String secondaryThumbprint)

Constructor that saves a thumbprint used for self signed authentication

AuthenticationMechanism(SymmetricKey symmetricKey)

Constructor that saves a symmetric key used for SAS authentication

Method Summary

Modifier and Type Method and Description
AuthenticationType getAuthenticationType()

Getter for authentication type.

String getPrimaryThumbprint()

Returns the primary thumbprint

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.

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(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

AuthenticationMechanism

public AuthenticationMechanism(SymmetricKey symmetricKey)

Constructor that saves a symmetric key used for SAS authentication

Parameters:

symmetricKey - the key to use for authentication

Method Details

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 benull 

</code></p>

getSecondaryThumbprint

public String getSecondaryThumbprint()

Returns the secondary thumbprint

Returns:

the secondary thumbprint. It may benull 

</code></p>

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

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

Applies to