private RevokeRequestBuilder() {
}
public XKMSElement buildElement(OMElement element) throws XKMSException {
RevokeRequest revokeRequest = new RevokeRequest();
super.buildElement(element, revokeRequest);
OMElement revokeKeyBindingElement = element
.getFirstChildWithName(XKMS2Constants.Q_ELEM_REVOKE_KEY_BINDING);
if (revokeKeyBindingElement == null) {
throw new XKMSException("RevokeKeyBinding element not found");
}
revokeRequest
.setRevokeKeyBinding((RevokeKeyBinding) RevokeKeyBindingBuilder.INSTANCE
.buildElement(revokeKeyBindingElement));
if (revokeRequest.getAuthentication() == null) {
OMElement revocationCodeElem = element
.getFirstChildWithName(XKMS2Constants.Q_ELEM_REVOCATION_CODE);
if (revocationCodeElem != null) {
revokeRequest.setRevocationCode(Base64.decode(revocationCodeElem
.getText()));
} else {
throw new XKMSException(
"Neither Authentication nor RevocationCode found");
}