in xsec/xkms/impl/XKMSKeyBindingAbstractTypeImpl.cpp [96:166]
void XKMSKeyBindingAbstractTypeImpl::load(void) {
if (mp_keyBindingAbstractTypeElement == NULL) {
throw XSECException(XSECException::ExpectedXKMSChildNotFound,
"XKMSKeyBindingAbstractTypeImpl::load - called on empty DOM");
}
// Id
mp_idAttr =
mp_keyBindingAbstractTypeElement->getAttributeNodeNS(NULL, XKMSConstants::s_tagId);
DOMElement * tmpElt = findFirstElementChild(mp_keyBindingAbstractTypeElement);
if (tmpElt != NULL && strEquals(getDSIGLocalName(tmpElt), XKMSConstants::s_tagKeyInfo)) {
if (mp_keyInfoList != NULL)
delete mp_keyInfoList;
XSECnew(mp_keyInfoList, DSIGKeyInfoList(mp_env));
mp_keyInfoList->loadListFromXML(tmpElt);
mp_keyInfoElement = tmpElt;
tmpElt = findNextElementChild(tmpElt);
}
while (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagKeyUsage)) {
DOMNode * txt = findFirstChildOfType(tmpElt, DOMNode::TEXT_NODE);
if (txt == NULL) {
throw XSECException(XSECException::ExpectedXKMSChildNotFound,
"XKMSKeyBindingAbstractTypeImpl::load - Require text node beneath <KeyUsage>");
}
const XMLCh * usageStr = txt->getNodeValue();
int index = XMLString::indexOf(usageStr, chPound);
if (index == -1 || XMLString::compareNString(usageStr, XKMSConstants::s_unicodeStrURIXKMS, index)) {
throw XSECException(XSECException::XKMSError,
"XKMSResultType::load - KeyUsage not in XKMS Name Space");
}
usageStr = &usageStr[index+1];
if (strEquals(usageStr, XKMSConstants::s_tagEncryption)) {
mp_keyUsageEncryptionElement = tmpElt;
} else if (strEquals(usageStr, XKMSConstants::s_tagExchange)) {
mp_keyUsageExchangeElement = tmpElt;
} else if (strEquals(usageStr, XKMSConstants::s_tagSignature)) {
mp_keyUsageSignatureElement = tmpElt;
} else {
throw XSECException(XSECException::ExpectedXKMSChildNotFound,
"XKMSKeyBindingAbstractTypeImpl::load - require Encryption, Exchange or Signature text node beneath <KeyUsage>");
}
tmpElt = findNextElementChild(tmpElt);
}
while (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagUseKeyWith)) {
XKMSUseKeyWithImpl *ukw;
XSECnew(ukw, XKMSUseKeyWithImpl(mp_env, tmpElt));
m_useKeyWithList.push_back(ukw);
ukw->load();
tmpElt = findNextElementChild(tmpElt);
}
}