com.yoti.api.client.spi.remote.AttributeListReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yoti-sdk-api Show documentation
Show all versions of yoti-sdk-api Show documentation
Java SDK for simple integration with the Yoti platform
The newest version!
package com.yoti.api.client.spi.remote;
import java.security.Key;
import java.util.ArrayList;
import java.util.List;
import com.yoti.api.client.Attribute;
import com.yoti.api.client.ProfileException;
public class AttributeListReader {
private final EncryptedDataReader encryptedDataReader;
private final AttributeListConverter attributeListConverter;
private AttributeListReader(
EncryptedDataReader encryptedDataReader,
AttributeListConverter attributeListConverter) {
this.encryptedDataReader = encryptedDataReader;
this.attributeListConverter = attributeListConverter;
}
public static AttributeListReader newInstance() {
return new AttributeListReader(
EncryptedDataReader.newInstance(),
AttributeListConverter.newInstance()
);
}
public List> read(byte[] encryptedProfileBytes, Key secretKey) throws ProfileException {
List> attributeList = new ArrayList<>();
if (encryptedProfileBytes != null && encryptedProfileBytes.length > 0) {
byte[] profileData = encryptedDataReader.decryptBytes(encryptedProfileBytes, secretKey);
attributeList = attributeListConverter.parseAttributeList(profileData);
}
return attributeList;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy