Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/************************************************************************
* *
* Certificate Service - Messages *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
* License as published by the Free Software Foundation; either *
* version 3 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.certificateservices.messages.csmessages;
import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Properties;
import javax.xml.bind.Marshaller;
import org.certificateservices.messages.MessageContentException;
import org.certificateservices.messages.MessageProcessingException;
import org.certificateservices.messages.MessageSecurityProvider;
import org.certificateservices.messages.csmessages.jaxb.ApprovalStatus;
import org.certificateservices.messages.csmessages.jaxb.CSMessage;
import org.certificateservices.messages.csmessages.jaxb.Credential;
import org.certificateservices.messages.csmessages.jaxb.RequestStatus;
import org.w3c.dom.Document;
public interface CSMessageParser {
/**
* Method that initializes the CSMessage parser with a security provider and properties.
*
* @param securityProvider the CSMessage security provider to use.
* @param config the configuration of the parser.
* @throws MessageProcessingException if configuration contained bad configuration of security provider.
*/
void init(MessageSecurityProvider securityProvider, Properties config) throws MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* This method always validates and authorizes the signing certificate.
*
* @param messageData the data to parse into a CSMessage
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(byte[] messageData)
throws MessageContentException, MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* Signatures are required.
*
*
* @param messageData the data to parse into a CSMessage
* @param performValidation true if the message security provider should perform
* validate that the signing certificate is valid and authorized for related organisation.
* Otherwise must validation be performed manually after the message is parsed.
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(byte[] messageData, boolean performValidation)
throws MessageContentException, MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* @param messageData the data to parse into a CSMessage
* @param performValidation true if the message security provider should perform
* validate that the signing certificate is valid and authorized for related organisation.
* Otherwise must validation be performed manually after the message is parsed.
* @param requireSignature if signature should be required.
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(byte[] messageData, boolean performValidation, boolean requireSignature)
throws MessageContentException, MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* This method always validates and authorizes the signing certificate.
*
* @param doc The Document data to parse into a CSMessage
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(Document doc)
throws MessageContentException, MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* Signatures are required.
*
* @param doc The Document data to parse into a CSMessage
* @param performValidation true if the message security provider should perform
* validate that the signing certificate is valid and authorized for related organisation.
* Otherwise must validation be performed manually after the message is parsed.
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(Document doc, boolean performValidation)
throws MessageContentException, MessageProcessingException;
/**
* Method to parse a message into a CSMessage and verify that it fulfills the registred schemas.
*
* Signatures are required.
*
* @param doc The Document data to parse into a CSMessage
* @param performValidation true if the message security provider should perform
* validate that the signing certificate is valid and authorized for related organisation.
* Otherwise must validation be performed manually after the message is parsed.
* @param requireSignature if signature should be required.
* @return a parsed CS Message object.
*
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
CSMessage parseMessage(Document doc, boolean performValidation, boolean requireSignature)
throws MessageContentException, MessageProcessingException;
/**
* Method used to generate a CS Request message without any originator, i.e the signer of this message is the originator.
*
* @param requestId id of request to send.
* @param destinationId the destination Id to use.
* @param organisation the related organisation (short name)
* @param payLoadVersion version of the pay load structure.
* @param payload the pay load object
* @param assertions a list of authorization assertions or null if no assertions should be inserted.
* @return a generated and signed (if configured) message.
* @throws MessageContentException if input data contained invalid format.
* @throws MessageProcessingException if internal problems occurred processing the cs message.
*/
byte[] generateCSRequestMessage(String requestId, String destinationId, String organisation, String payLoadVersion, Object payload, List