+ Category& log=Category::getInstance(XMLTOOLING_LOGCAT".CredentialResolver."FILESYSTEM_CREDENTIAL_RESOLVER);
+
+ // Default to disable X509IssuerSerial due to schema validation issues.
+ m_keyinfomask =
+ Credential::KEYINFO_KEY_NAME |
+ Credential::KEYINFO_KEY_VALUE |
+ X509Credential::KEYINFO_X509_CERTIFICATE |
+ X509Credential::KEYINFO_X509_SUBJECTNAME;
+ if (e && e->hasAttributeNS(nullptr,keyInfoMask))
+ m_keyinfomask = XMLString::parseInt(e->getAttributeNS(nullptr,keyInfoMask));
+
+ if (e && (e->hasAttributeNS(nullptr,_certificate) || e->hasAttributeNS(nullptr,_key))) {
+ // Dummy up a simple file resolver config using these attributes.
+ DOMElement* dummy = e->getOwnerDocument()->createElementNS(nullptr,_CredentialResolver);
+ DOMElement* child;
+ DOMElement* path;
+ if (e->hasAttributeNS(nullptr,_key)) {
+ child = e->getOwnerDocument()->createElementNS(nullptr,Key);
+ dummy->appendChild(child);
+ path = e->getOwnerDocument()->createElementNS(nullptr,Path);
+ child->appendChild(path);
+ path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,_key)));
+ if (e->hasAttributeNS(nullptr,password))
+ child->setAttributeNS(nullptr,password,e->getAttributeNS(nullptr,password));
+ if (e->hasAttributeNS(nullptr,keyName)) {
+ path = e->getOwnerDocument()->createElementNS(nullptr,Name);
+ child->appendChild(path);
+ path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,keyName)));
+ }
+ }
+ if (e->hasAttributeNS(nullptr,_certificate)) {
+ child = e->getOwnerDocument()->createElementNS(nullptr,Certificate);
+ dummy->appendChild(child);
+ path = e->getOwnerDocument()->createElementNS(nullptr,Path);
+ child->appendChild(path);
+ path->appendChild(e->getOwnerDocument()->createTextNode(e->getAttributeNS(nullptr,_certificate)));
+ if (e->hasAttributeNS(nullptr, extractNames))
+ child->setAttributeNS(nullptr, extractNames, e->getAttributeNS(nullptr, extractNames));
+ }
+ e = dummy; // reset "root" to the dummy config element
+ }