SecurityProviderSymmetricKey Class
- java.
lang. Object - SecurityProvider
- com.
microsoft. azure. sdk. iot. provisioning. security. SecurityProviderSymmetricKey
- com.
public class SecurityProviderSymmetricKey extends SecurityProvider
Constructor Summary
Constructor | Description |
---|---|
SecurityProviderSymmetricKey(byte[] symmetricKey, String registrationId) |
Constructor for Symmetric key security provider |
SecurityProviderSymmetricKey(String primaryKey, String secondaryKey, String registrationId) |
Constructor for Symmetric key security provider that takes both keys |
Method Summary
Modifier and Type | Method and Description |
---|---|
byte [] |
ComputeDerivedSymmetricKey(byte[] enrollmentGroupSymmetricKey, String deviceId)
Compute the derived symmetric key for authenticating your device based on it's group enrollment's symmetric key and from the device's registrationId. This step is only necessary for devices in group enrollments. Devices that are registered via an individual enrollment can use the individual enrollment's symmetric key directly. |
String |
getRegistrationId()
Unique id required for registration |
byte [] |
getSecondaryKey()
Getter for Secondary key |
byte [] |
getSymmetricKey()
Getter for Symmetric key |
byte [] |
HMACSignData(byte[] signature, byte[] base64DecodedKey)
Signs data using the provided base 64 decoded key using HMAC SHA 256 |
Inherited Members
Constructor Details
SecurityProviderSymmetricKey
public SecurityProviderSymmetricKey(byte[] symmetricKey, String registrationId)
Constructor for Symmetric key security provider
Parameters:
SecurityProviderSymmetricKey
public SecurityProviderSymmetricKey(String primaryKey, String secondaryKey, String registrationId)
Constructor for Symmetric key security provider that takes both keys
Parameters:
Method Details
ComputeDerivedSymmetricKey
public static byte [] ComputeDerivedSymmetricKey(byte[] enrollmentGroupSymmetricKey, String deviceId)
Compute the derived symmetric key for authenticating your device based on it's group enrollment's symmetric key and from the device's registrationId. This step is only necessary for devices in group enrollments. Devices that are registered via an individual enrollment can use the individual enrollment's symmetric key directly.
Parameters:
Returns:
Throws:
getRegistrationId
public String getRegistrationId()
Unique id required for registration
Returns:
Throws:
getSecondaryKey
public byte [] getSecondaryKey()
Getter for Secondary key
Returns:
getSymmetricKey
public byte [] getSymmetricKey()
Getter for Symmetric key
Returns:
HMACSignData
public byte [] HMACSignData(byte[] signature, byte[] base64DecodedKey)
Signs data using the provided base 64 decoded key using HMAC SHA 256
Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java