return modelKeyNameKDV;
}
private static KeyDataValue mapKeyValue(JAXBElement apiKeyInfoContentJAXB, List<KeyDataValue> keyInfoDataValues) {
KeyValueType kvt = (KeyValueType)apiKeyInfoContentJAXB.getValue();
KeyDataValue modelKeyValueKDV = new KeyDataValue();
modelKeyValueKDV.setKeyDataType(KeyValueType.class.getSimpleName());
modelKeyValueKDV.setKeyDataName(apiKeyInfoContentJAXB.getName().getLocalPart());
keyInfoDataValues.add(modelKeyValueKDV);
List<Object> kvObjList = kvt.getContent();
for (Object kvObj : kvObjList) {
if (kvObj instanceof JAXBElement) {
JAXBElement kvJAXB = (JAXBElement)kvObj;
Object childVal = kvJAXB.getValue();
KeyDataValue childKDV = new KeyDataValue();
childKDV.setKeyDataValue(modelKeyValueKDV);
childKDV.setKeyDataName(kvJAXB.getName().getLocalPart());
childKDV.setKeyDataType(childVal.getClass().getSimpleName());
modelKeyValueKDV.getKeyDataValueList().add(childKDV);
if (childVal instanceof DSAKeyValueType) {
DSAKeyValueType dsaKeyVal = (DSAKeyValueType)childVal;
String dsaKeyValueTagName = kvJAXB.getName().getLocalPart();
KeyDataValue dsaKeyValKDV = new KeyDataValue(null, DSAKeyValueType.class.getSimpleName(), dsaKeyValueTagName, null, null, childKDV);
childKDV.getKeyDataValueList().add(dsaKeyValKDV);
KeyDataValue gValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "G", dsaKeyVal.getG(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(gValKDV);
KeyDataValue jValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "J", dsaKeyVal.getJ(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(jValKDV);
KeyDataValue pValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "P", dsaKeyVal.getP(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(pValKDV);
KeyDataValue pGenCounterValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "PgenCounter", dsaKeyVal.getPgenCounter(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(pGenCounterValKDV);
KeyDataValue qValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Q", dsaKeyVal.getQ(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(qValKDV);
KeyDataValue seedValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Seed", dsaKeyVal.getSeed(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(seedValKDV);
KeyDataValue yValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Y", dsaKeyVal.getY(), null, dsaKeyValKDV);
dsaKeyValKDV.getKeyDataValueList().add(yValKDV);
} else if (childVal instanceof RSAKeyValueType) {
RSAKeyValueType rsaKeyVal = (RSAKeyValueType)childVal;
String rsaKeyValueTagName = kvJAXB.getName().getLocalPart();
KeyDataValue rsaKeyValKDV = new KeyDataValue(null, RSAKeyValueType.class.getSimpleName(), rsaKeyValueTagName, null, null, childKDV);
childKDV.getKeyDataValueList().add(rsaKeyValKDV);
KeyDataValue exponentValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Exponent", rsaKeyVal.getExponent(), null, rsaKeyValKDV);
rsaKeyValKDV.getKeyDataValueList().add(exponentValKDV);
KeyDataValue modulusValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Modulus", rsaKeyVal.getModulus(), null, rsaKeyValKDV);
rsaKeyValKDV.getKeyDataValueList().add(modulusValKDV);
}
}
}
return modelKeyValueKDV;