Class CSExportDataParser


  • public class CSExportDataParser
    extends java.lang.Object
    Class 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.
    • 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

      • 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 export
        tokenTypes - 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,
                                      MessageContentException
        Method 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 export
        tokenTypes - 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