Class V2XBackendPayloadParser
- java.lang.Object
-
- org.certificateservices.messages.csmessages.BasePayloadParser
-
- org.certificateservices.messages.v2x.backend.V2XBackendPayloadParser
-
- All Implemented Interfaces:
PayloadParser
public class V2XBackendPayloadParser extends BasePayloadParser
Payload Parser for generating V2X Backend messages according to v2x_backend_schema2_0.xsd
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMESPACE-
Fields inherited from class org.certificateservices.messages.csmessages.BasePayloadParser
config, csMessageObjectFactory, customCSMessageParser, payloadVersion, secProv
-
-
Constructor Summary
Constructors Constructor Description V2XBackendPayloadParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]generateSignCertRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String canonicalId, java.lang.Integer assuranceLevel, java.lang.Integer confidenceLevel, java.lang.String caId, java.lang.String profileName, ValidityUnitType validityUnit, java.lang.Integer validityDuration, RegionsType regions, byte[] publicVerificationKey, byte[] publicEncryptionKey, byte[] requestHash, Credential originator, java.util.List<java.lang.Object> assertions)Method generate a Sign Cert Request Message.CSMessageResponseDatagenerateSignCertResponse(java.lang.String relatedEndEntity, CSMessage request, java.lang.String canonicalId, java.lang.String responseCode, java.lang.String message, byte[] responseData)Method generate a Sign Cert Response Message.byte[]generateSignErrorRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String canonicalId, java.lang.String caId, java.lang.String responseCode, java.lang.String message, byte[] requestHash, Credential originator, java.util.List<java.lang.Object> assertions)Method generate a SignErrorRequest messageCSMessageResponseDatagenerateSignErrorResponse(java.lang.String relatedEndEntity, CSMessage request, java.lang.String canonicalId, java.lang.String responseCode, java.lang.String message, byte[] responseData)Method generate a Sign Error Response Message.protected java.lang.StringgetDefaultPayloadVersion()java.lang.StringgetJAXBPackage()Method that returns the JAXBPackage Name for the package name containing the JAXB classes.java.lang.StringgetNameSpace()java.lang.String[]getRelatedSchemas(java.lang.String payloadVersion)Method that returns related v2x schemajava.io.InputStreamgetSchemaAsInputStream(java.lang.String payLoadVersion)Method that should return the location of the schema for a given payLoadVersion, it should be accessable as a class resource using getClass().getResourceAsStream()protected java.lang.String[]getSupportedVersions()-
Methods inherited from class org.certificateservices.messages.csmessages.BasePayloadParser
generateGetApprovalRequest, generateIsApprovedRequest, getAssertions, getCSMessageParser, getPayload, getPayloadVersion, getResponseStatus, init, init, isPayloadVersionSupported, parseMessage, parseMessage, parseMessage, setPayloadVersion
-
-
-
-
Method Detail
-
getJAXBPackage
public java.lang.String getJAXBPackage()
Description copied from interface:PayloadParserMethod that returns the JAXBPackage Name for the package name containing the JAXB classes. For multiple package names use a ':' without spaces.- See Also:
PayloadParser.getJAXBPackage()
-
getNameSpace
public java.lang.String getNameSpace()
- Returns:
- the related pay load elements unique name space.
- See Also:
PayloadParser.getNameSpace()
-
getSchemaAsInputStream
public java.io.InputStream getSchemaAsInputStream(java.lang.String payLoadVersion) throws MessageContentException, MessageProcessingExceptionDescription copied from interface:PayloadParserMethod that should return the location of the schema for a given payLoadVersion, it should be accessable as a class resource using getClass().getResourceAsStream()- Throws:
MessageContentException- if given version isn't supported.MessageProcessingException- if problems occurred setting up the stream.- See Also:
PayloadParser.getSchemaAsInputStream(String)
-
getRelatedSchemas
public java.lang.String[] getRelatedSchemas(java.lang.String payloadVersion)
Method that returns related v2x schema- Specified by:
getRelatedSchemasin interfacePayloadParser- Overrides:
getRelatedSchemasin classBasePayloadParser- Parameters:
payloadVersion- payload version.- Returns:
- an array of related schemas if no related schemas exists is empty array returned, never null.
-
getSupportedVersions
protected java.lang.String[] getSupportedVersions()
- Specified by:
getSupportedVersionsin classBasePayloadParser- Returns:
- an array of version numbers of payload that is supported by this parser.
- See Also:
BasePayloadParser.getSupportedVersions()
-
getDefaultPayloadVersion
protected java.lang.String getDefaultPayloadVersion()
- Specified by:
getDefaultPayloadVersionin classBasePayloadParser- Returns:
- returns the payload version used by default when generating request messages.
- See Also:
BasePayloadParser.getDefaultPayloadVersion()
-
generateSignCertRequest
public byte[] generateSignCertRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String canonicalId, java.lang.Integer assuranceLevel, java.lang.Integer confidenceLevel, java.lang.String caId, java.lang.String profileName, ValidityUnitType validityUnit, java.lang.Integer validityDuration, RegionsType regions, byte[] publicVerificationKey, byte[] publicEncryptionKey, byte[] requestHash, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod generate a Sign Cert Request Message.- Parameters:
requestId- id of request to send. (Required)destinationId- the destination Id to use. (Required)organisation- the related organisation (short name) (Required)canonicalId- the canonical name of the ITS to register. Should be a unique identifier. (Required)assuranceLevel- the assurance level to set in the certificate (Optional, use if assuranceLevel and confidenceLevel should be set).confidenceLevel- the confidenceLevel level to set in the certificate (Optional, use if assuranceLevel and confidenceLevel should be set).caId- the hashedId8 of related CA in hexadecimal representation.profileName- Name of profile to use for the credential. The profile determines Service Permissions, default region and validity. If not set is default profile for default profile is used.validityUnit- the unit used for the maximum end date for EC if specified, if empty is profile validity used. (Optional)validityDuration- the duration value the maximum end date for EC if specified, if empty is profile validity used. (Optional)regions- Defines specific regions for this vehicle. The defined regions is checked against the profile and only regions that are a subset of regions defined in related profile will be accepted. If not set is the default regions set in related profile used. (Optional)publicVerificationKey- the public verification key as a COER encoded PublicVerificationKey from ETSI 103 097. (Required)publicEncryptionKey- the public verification key as a COER encoded PublicEncryptionKey from ETSI 103 097. (Optional)requestHash- the related request message hash (Required).originator- the credential of the original requester, null if this is the origin of the request.assertions- a list of related authorization assertions, or null if no authorization assertions is available.- Returns:
- a generated and signed (if configured) message.
- Throws:
MessageContentException- if input data contained invalid format.MessageProcessingException- if internal problems occurred processing the cs message.
-
generateSignCertResponse
public CSMessageResponseData generateSignCertResponse(java.lang.String relatedEndEntity, CSMessage request, java.lang.String canonicalId, java.lang.String responseCode, java.lang.String message, byte[] responseData) throws MessageContentException, MessageProcessingException
Method generate a Sign Cert Response Message.- Parameters:
relatedEndEntity- the name of the related end entity (such as username of the related user)request- the related requestcanonicalId- the canonical name of the ITS to register. Should be a unique identifier. (Required)responseCode- name representation of one result code in related enrolment protocol. (Required)message- descriptive messate related to the response used in logging (Optional)responseData- the signed response data. (Required)- Returns:
- a generated and signed message.
- Throws:
MessageContentException- if input data contained invalid format.MessageProcessingException- if internal problems occurred processing the cs message.
-
generateSignErrorRequest
public byte[] generateSignErrorRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String canonicalId, java.lang.String caId, java.lang.String responseCode, java.lang.String message, byte[] requestHash, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod generate a SignErrorRequest message- Parameters:
requestId- id of request to send.destinationId- the destination Id to use.canonicalId- the canonical name of the ITS to register. Should be a unique identifier. (Required)caId- the hashedId8 of related CA in hexadecimal representation.responseCode- name representation of one result code in related enrolment protocol. (Required)requestHash- the related request message hashmessage- descriptive messate related to the response used in logging (Required)originator- the credential of the original requester, null if this is the origin of the request.assertions- a list of related authorization assertions, or null if no authorization assertions is available.- Returns:
- a generated and signed (if configured) message.
- Throws:
MessageContentException- if input data contained invalid format.MessageProcessingException- if internal problems occurred processing the cs message.
-
generateSignErrorResponse
public CSMessageResponseData generateSignErrorResponse(java.lang.String relatedEndEntity, CSMessage request, java.lang.String canonicalId, java.lang.String responseCode, java.lang.String message, byte[] responseData) throws MessageContentException, MessageProcessingException
Method generate a Sign Error Response Message.- Parameters:
relatedEndEntity- the name of the related end entity (such as username of the related user)request- the related requestcanonicalId- the canonical name of the ITS to register. Should be a unique identifier. (Required)responseCode- name representation of one result code in related enrolment protocol. (Required)message- descriptive messate related to the response used in logging (Optional)responseData- the signed response data. (Required)- Returns:
- a generated and signed message.
- Throws:
MessageContentException- if input data contained invalid format.MessageProcessingException- if internal problems occurred processing the cs message.
-
-