Class CSExportDataParser
- java.lang.Object
-
- org.certificateservices.messages.csexport.data.CSExportDataParser
-
public class CSExportDataParser extends java.lang.ObjectClass to generate and parse Hard Token Data Structures. It has also methods to create encrypted binary data defined in the credential managment protocol 2.0 specification.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCSExportDataParser.CSExportDataSignatureLocationFinderclassCSExportDataParser.CSExportLSResourceResolver
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_VERSIONstatic java.lang.StringNAMESPACEstatic java.lang.StringVERSION_1_0static java.lang.StringVERSION_1_1static java.lang.StringVERSION_1_2static java.lang.StringVERSION_1_3static java.lang.StringVERSION_1_4
-
Constructor Summary
Constructors Constructor Description CSExportDataParser(MessageSecurityProvider securityProvider, boolean requireSignature)Constructor for CSExportDataParser, this is the default method to create a parser, it should not be fetched by the PayloadParserRegistry since this is not a CSMessagePayload.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]genCSExport_1_x(java.lang.String version, java.util.List<Organisation> organisations, java.util.List<TokenType> tokenTypes)Method to create a signed CSExport data structure returned as byte[].CSExportgenCSExport_1_xAsObject(java.lang.String version, java.util.List<Organisation> organisations, java.util.List<TokenType> tokenTypes)Method to create a signed CSExport data structure returned as CSExport JAXB object.byte[]marshallCSExportData(CSExport csExport)Method to marshall an CSExport method to an byte array.CSExportparse(byte[] data)Method to parse a CSExport.
-
-
-
Field Detail
-
NAMESPACE
public static java.lang.String NAMESPACE
-
DEFAULT_VERSION
public static java.lang.String DEFAULT_VERSION
-
VERSION_1_0
public static java.lang.String VERSION_1_0
-
VERSION_1_1
public static java.lang.String VERSION_1_1
-
VERSION_1_2
public static java.lang.String VERSION_1_2
-
VERSION_1_3
public static java.lang.String VERSION_1_3
-
VERSION_1_4
public static java.lang.String VERSION_1_4
-
-
Constructor Detail
-
CSExportDataParser
public CSExportDataParser(MessageSecurityProvider securityProvider, boolean requireSignature) throws MessageProcessingException
Constructor for CSExportDataParser, this is the default method to create a parser, it should not be fetched by the PayloadParserRegistry since this is not a CSMessagePayload.- Parameters:
securityProvider- the security provider to use for encrypting and decrypting messages.requireSignature- if signatures should be expected and verified in export data.- Throws:
MessageProcessingException- if internal problems occurred initializing the parser.
-
-
Method Detail
-
parse
public CSExport parse(byte[] data) throws MessageContentException, MessageProcessingException
Method to parse a CSExport.- Parameters:
data- a serialized hard token data XML structure.- Returns:
- a unmarshalled HardTokenData.
- Throws:
MessageContentException- if xml data was invalidMessageProcessingException- if internal problems occurred unmarshalling the data.
-
genCSExport_1_xAsObject
public CSExport genCSExport_1_xAsObject(java.lang.String version, java.util.List<Organisation> organisations, java.util.List<TokenType> tokenTypes) throws MessageProcessingException, MessageContentException
Method to create a signed CSExport data structure returned as CSExport JAXB object.This method isn't very efficient, and should be used for high performance processing.
All parameters must be set.
- Parameters:
version- the export data schema version to use.organisations- the list of organisations to include in exporttokenTypes- the list of token types to include in export- Returns:
- a newly generated cs export data.
- Throws:
MessageProcessingException- if internal errors occurred processing the message.MessageContentException- if parameter contained data that didn't fullfill schema.
-
genCSExport_1_x
public byte[] genCSExport_1_x(java.lang.String version, java.util.List<Organisation> organisations, java.util.List<TokenType> tokenTypes) throws MessageProcessingException, MessageContentExceptionMethod to create a signed CSExport data structure returned as byte[].All parameters must be set.
- Parameters:
version- the export data schema version to use.organisations- the list of organisations to include in exporttokenTypes- the list of token types to include in export- Returns:
- a newly generated cs export data.
- Throws:
MessageProcessingException- if internal errors occurred processing the message.MessageContentException- if parameter contained data that didn't fullfill schema.
-
marshallCSExportData
public byte[] marshallCSExportData(CSExport csExport) throws MessageContentException
Method to marshall an CSExport method to an byte array. This method doesn't do any signing only converts from JAXB to byte[]- Parameters:
csExport- the CSExport object to convert, never null- Returns:
- byte array representation of the object.
- Throws:
MessageContentException
-
-