Class CredManagementPayloadParser

  • All Implemented Interfaces:
    PayloadParser

    public class CredManagementPayloadParser
    extends BasePayloadParser
    Payload Parser for generating Credential Management messages according to credmanagement_schema2_0.xsd
    • Field Detail

      • NAMESPACE

        public static java.lang.String NAMESPACE
      • CREDMANAGEMENT_XSD_SCHEMA_2_0_RESOURCE_LOCATION

        public static final java.lang.String CREDMANAGEMENT_XSD_SCHEMA_2_0_RESOURCE_LOCATION
        See Also:
        Constant Field Values
      • CREDMANAGEMENT_XSD_SCHEMA_2_1_RESOURCE_LOCATION

        public static final java.lang.String CREDMANAGEMENT_XSD_SCHEMA_2_1_RESOURCE_LOCATION
        See Also:
        Constant Field Values
      • CREDMANAGEMENT_XSD_SCHEMA_2_2_RESOURCE_LOCATION

        public static final java.lang.String CREDMANAGEMENT_XSD_SCHEMA_2_2_RESOURCE_LOCATION
        See Also:
        Constant Field Values
      • CREDMANAGEMENT_XSD_SCHEMA_2_3_RESOURCE_LOCATION

        public static final java.lang.String CREDMANAGEMENT_XSD_SCHEMA_2_3_RESOURCE_LOCATION
        See Also:
        Constant Field Values
    • Constructor Detail

      • CredManagementPayloadParser

        public CredManagementPayloadParser()
    • Method Detail

      • getJAXBPackage

        public java.lang.String getJAXBPackage()
        Description copied from interface: PayloadParser
        Method 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()
      • genIssueTokenCredentialsRequest

        public byte[] genIssueTokenCredentialsRequest​(java.lang.String requestId,
                                                      java.lang.String destinationId,
                                                      java.lang.String organisation,
                                                      TokenRequest tokenRequest,
                                                      java.util.List<FieldValue> fieldValues,
                                                      HardTokenData hardTokenData,
                                                      Credential originator,
                                                      java.util.List<java.lang.Object> assertions)
                                               throws MessageContentException,
                                                      MessageProcessingException
        Method to a IssueTokenCredentialRequest message and populating it with the tokenRequest.
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenRequest - the tokenRequest to add to the CSRequest.
        fieldValues - containing complementary input data to the request. Can be null if no complementary data is available.
        hardTokenData - related hard token data to be stored in encrypted storage. Null if not applicable
        originator - the original requester of a message, null if not applicable
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        generated and signed CSMessage in byte[] format.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIssueTokenCredentialsRequest

        public byte[] genIssueTokenCredentialsRequest​(java.lang.String requestId,
                                                      java.lang.String destinationId,
                                                      java.lang.String organisation,
                                                      TokenRequest tokenRequest,
                                                      java.util.List<FieldValue> fieldValues,
                                                      HardTokenData hardTokenData,
                                                      java.util.List<RecoverableKey> recoverableKeys,
                                                      Credential originator,
                                                      java.util.List<java.lang.Object> assertions)
                                               throws MessageContentException,
                                                      MessageProcessingException
        Method to a IssueTokenCredentialRequest message and populating it with the tokenRequest.
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenRequest - the tokenRequest to add to the CSRequest.
        fieldValues - containing complementary input data to the request. Can be null if no complementary data is available.
        hardTokenData - related hard token data to be stored in encrypted storage. Null if not applicable
        recoverableKeys - a list of keys that should be stored in backed for later recovery in case token is lost.
        originator - the original requester of a message, null if not applicable
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        generated and signed CSMessage in byte[] format.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIssueTokenCredentialsResponse

        public CSMessageResponseData genIssueTokenCredentialsResponse​(java.lang.String relatedEndEntity,
                                                                      CSMessage request,
                                                                      java.util.List<Credential> credentials,
                                                                      java.util.List<Credential> revokedCredentials,
                                                                      java.util.List<java.lang.Object> assertions)
                                                               throws MessageContentException,
                                                                      MessageProcessingException
        Method to a IssueTokenCredentialResponse message and populating it with the tokenRequest and the generated responses.
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        credentials - the credentials to populate the response with.
        revokedCredentials - credentials revoked in the operation or null, if no credentials where revoked.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeCredentialStatusRequest

        public byte[] genChangeCredentialStatusRequest​(java.lang.String requestId,
                                                       java.lang.String destinationId,
                                                       java.lang.String organisation,
                                                       java.lang.String issuerId,
                                                       java.lang.String serialNumber,
                                                       int newCredentialStatus,
                                                       java.lang.String reasonInformation,
                                                       Credential originator,
                                                       java.util.List<java.lang.Object> assertions)
                                                throws MessageContentException,
                                                       MessageProcessingException
        Method to generate a ChangeCredentialStatusRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The serial number of the credential in hexadecimal encoding lowercase (for X509 certificates).
        newCredentialStatus - The new credential status to set.
        reasonInformation - More detailed information about the revocation status
        originator - the original requester of a message, null if not applicable
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeCredentialStatusResponse

        public CSMessageResponseData genChangeCredentialStatusResponse​(java.lang.String relatedEndEntity,
                                                                       CSMessage request,
                                                                       java.lang.String issuerId,
                                                                       java.lang.String serialNumber,
                                                                       int credentialStatus,
                                                                       java.lang.String reasonInformation,
                                                                       java.util.Date revocationDate,
                                                                       java.util.List<java.lang.Object> assertions)
                                                                throws MessageContentException,
                                                                       MessageProcessingException
        Method to generate a ChangeCredentialStatusResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The serial number of the credential in hexadecimal encoding lowercase (for X509 certificates).
        credentialStatus - the resulted credential status of the request
        reasonInformation - More detailed information about the revocation status
        revocationDate - the timestamp when the credential was revoked.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeUserStatusRequest

        public byte[] genChangeUserStatusRequest​(java.lang.String requestId,
                                                 java.lang.String destinationId,
                                                 java.lang.String organisation,
                                                 java.lang.String userUniqueId,
                                                 TokenFilter tokenFilter,
                                                 CredentialFilter credentialFilter,
                                                 int newCredentialStatus,
                                                 java.lang.String reasonInformation,
                                                 Credential originator,
                                                 java.util.List<java.lang.Object> assertions)
                                          throws MessageContentException,
                                                 MessageProcessingException
        Method to generate a ChangeUserStatusRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        userUniqueId - The unique id of the user to revoke credentials for.
        tokenFilter - The token filter specifying a filter for a which credentials in the users token that should be revoked. Optional if null is all credentials for all tokens revoked (matching credential filter).
        credentialFilter - The credential filter used to specify which matching credentials that should be revoked. Optional if null is all credentials for all tokens revoked (matching optional token filter).
        newCredentialStatus - The new credential status to set.
        reasonInformation - More detailed information about the revocation status
        originator - the original requester of a message, null if not applicable
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeUserStatusResponse

        public CSMessageResponseData genChangeUserStatusResponse​(java.lang.String relatedEndEntity,
                                                                 CSMessage request,
                                                                 User user,
                                                                 java.util.List<java.lang.Object> assertions)
                                                          throws MessageContentException,
                                                                 MessageProcessingException
        Method to generate a ChangeUserStatusResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        user - The related user with updated token and credential information.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeTokenStatusRequest

        public byte[] genChangeTokenStatusRequest​(java.lang.String requestId,
                                                  java.lang.String destinationId,
                                                  java.lang.String organisation,
                                                  java.lang.String tokenSerialNumber,
                                                  CredentialFilter credentialFilter,
                                                  int newCredentialStatus,
                                                  java.lang.String reasonInformation,
                                                  Credential originator,
                                                  java.util.List<java.lang.Object> assertions)
                                           throws MessageContentException,
                                                  MessageProcessingException
        Method to generate a ChangeTokenStatusRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenSerialNumber - The unique serial number within the organisation.
        credentialFilter - The credential filter used to specify which matching credentials that should be revoked. Optional if null is all credentials for all tokens revoked (matching optional token filter).
        newCredentialStatus - The new credential status to set.
        reasonInformation - More detailed information about the revocation status
        originator - the original requester of a message, null if not applicable
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genChangeTokenStatusResponse

        public CSMessageResponseData genChangeTokenStatusResponse​(java.lang.String relatedEndEntity,
                                                                  CSMessage request,
                                                                  Token token,
                                                                  java.util.List<java.lang.Object> assertions)
                                                           throws MessageContentException,
                                                                  MessageProcessingException
        Method to generate a ChangeTokenStatusResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        token - The related token with updated credential information.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialRequest

        public byte[] genGetCredentialRequest​(java.lang.String requestId,
                                              java.lang.String destinationId,
                                              java.lang.String organisation,
                                              java.lang.String credentialSubType,
                                              java.lang.String issuerId,
                                              java.lang.String serialNumber,
                                              Credential originator,
                                              java.util.List<java.lang.Object> assertions)
                                       throws MessageContentException,
                                              MessageProcessingException
        Method to generate a GetCredentialRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        credentialSubType - the credential sub type of the credential.
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The serial number of the credential in hexadecimal encoding lowercase (for X509 certificates).
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialResponse

        public CSMessageResponseData genGetCredentialResponse​(java.lang.String relatedEndEntity,
                                                              CSMessage request,
                                                              Credential credential,
                                                              java.util.List<java.lang.Object> assertions)
                                                       throws MessageContentException,
                                                              MessageProcessingException
        Method to generate a GetCredentialResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        credential - the matching credential of the issued id and serial number
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialStatusListRequest

        public byte[] genGetCredentialStatusListRequest​(java.lang.String requestId,
                                                        java.lang.String destinationId,
                                                        java.lang.String organisation,
                                                        java.lang.String issuerId,
                                                        java.lang.Long serialNumber,
                                                        java.lang.String credentialStatusListType,
                                                        Credential originator,
                                                        java.util.List<java.lang.Object> assertions)
                                                 throws MessageContentException,
                                                        MessageProcessingException
        Method to generate a GetCredentialStatusListRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The number of the credential status list in the request (Optional)
        credentialStatusListType - The type of status list to fetch
        originator - the original requester of a message, null if not applicable.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialStatusListResponse

        public CSMessageResponseData genGetCredentialStatusListResponse​(java.lang.String relatedEndEntity,
                                                                        CSMessage request,
                                                                        CredentialStatusList credentialStatusList,
                                                                        java.util.List<java.lang.Object> assertions)
                                                                 throws MessageContentException,
                                                                        MessageProcessingException
        Method to generate a GetCredentialStatusListResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        credentialStatusList - the matching credential status list
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetIssuerCredentialsRequest

        public byte[] genGetIssuerCredentialsRequest​(java.lang.String requestId,
                                                     java.lang.String destinationId,
                                                     java.lang.String organisation,
                                                     java.lang.String issuerId,
                                                     Credential originator,
                                                     java.util.List<java.lang.Object> assertions)
                                              throws MessageContentException,
                                                     MessageProcessingException
        Method to generate a GetIssuerCredentialsRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetIssuerCredentialsResponse

        public CSMessageResponseData genGetIssuerCredentialsResponse​(java.lang.String relatedEndEntity,
                                                                     CSMessage request,
                                                                     Credential issuerCredential,
                                                                     java.util.List<java.lang.Object> assertions)
                                                              throws MessageContentException,
                                                                     MessageProcessingException
        Method to generate a GetIssuerCredentialsResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        issuerCredential - the issuers credential
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIsIssuerRequest

        public byte[] genIsIssuerRequest​(java.lang.String requestId,
                                         java.lang.String destinationId,
                                         java.lang.String organisation,
                                         java.lang.String issuerId,
                                         Credential originator,
                                         java.util.List<java.lang.Object> assertions)
                                  throws MessageContentException,
                                         MessageProcessingException
        Method to generate a IsIssuerRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIsIssuerResponse

        public CSMessageResponseData genIsIssuerResponse​(java.lang.String relatedEndEntity,
                                                         CSMessage request,
                                                         boolean isIssuer,
                                                         java.util.List<java.lang.Object> assertions)
                                                  throws MessageContentException,
                                                         MessageProcessingException
        Method to generate a IsIssuerResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        isIssuer - indicating if current server is issuer or not
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIssueCredentialStatusListRequest

        public byte[] genIssueCredentialStatusListRequest​(java.lang.String requestId,
                                                          java.lang.String destinationId,
                                                          java.lang.String organisation,
                                                          java.lang.String issuerId,
                                                          java.lang.String credentialStatusListType,
                                                          java.lang.Boolean force,
                                                          java.util.Date requestedValidFromDate,
                                                          java.util.Date requestedNotAfterDate,
                                                          Credential originator,
                                                          java.util.List<java.lang.Object> assertions)
                                                   throws MessageContentException,
                                                          MessageProcessingException
        Method to generate a IssueCredentialStatusListRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        credentialStatusListType - The type of status list to fetch
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException
        MessageProcessingException
      • genIssueCredentialStatusListResponse

        public CSMessageResponseData genIssueCredentialStatusListResponse​(java.lang.String relatedEndEntity,
                                                                          CSMessage request,
                                                                          CredentialStatusList credentialStatusList,
                                                                          java.util.List<java.lang.Object> assertions)
                                                                   throws MessageContentException,
                                                                          MessageProcessingException
        Method to generate a IssueCredentialStatusListResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        credentialStatusList - the new credential status list
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genIssueCredentialStatusListResponseWithoutRequest

        public CSMessageResponseData genIssueCredentialStatusListResponseWithoutRequest​(java.lang.String csMessageVersion,
                                                                                        java.lang.String payLoadVersion,
                                                                                        java.lang.String relatedEndEntity,
                                                                                        java.lang.String destinationId,
                                                                                        java.lang.String requestName,
                                                                                        java.lang.String organisation,
                                                                                        CredentialStatusList credentialStatusList,
                                                                                        Credential originator,
                                                                                        java.util.List<java.lang.Object> assertions)
                                                                                 throws MessageContentException,
                                                                                        MessageProcessingException
        Method to generate a IssueCredentialStatusListResponse where there are no request, such as scheduled CRL issuing.
        Parameters:
        csMessageVersion - the version of the CS Message Core protocol.
        payLoadVersion - the version of the credential management pay load protocol.
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        destinationId - the destination of the response set in the CS message.
        requestName - the name of the request message this response whould normally reply to.
        organisation - the organisation set in the response message.
        credentialStatusList - the new credential status list
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRemoveCredentialRequest

        public byte[] genRemoveCredentialRequest​(java.lang.String requestId,
                                                 java.lang.String destinationId,
                                                 java.lang.String organisation,
                                                 java.lang.String issuerId,
                                                 java.lang.String serialNumber,
                                                 Credential originator,
                                                 java.util.List<java.lang.Object> assertions)
                                          throws MessageContentException,
                                                 MessageProcessingException
        Method to generate a RemoveCredentialRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The serial number of the credential in hexadecimal encoding lowercase (for X509 certificates).
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRemoveCredentialResponse

        public CSMessageResponseData genRemoveCredentialResponse​(java.lang.String relatedEndEntity,
                                                                 CSMessage request,
                                                                 java.util.List<java.lang.Object> assertions)
                                                          throws MessageContentException,
                                                                 MessageProcessingException
        Method to generate a RemoveCredentialResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request to populate the response with
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genFetchHardTokenDataRequest

        public byte[] genFetchHardTokenDataRequest​(java.lang.String requestId,
                                                   java.lang.String destinationId,
                                                   java.lang.String organisation,
                                                   java.lang.String tokenSerial,
                                                   java.lang.String relatedCredentialIssuerId,
                                                   Credential adminCredential,
                                                   Credential originator,
                                                   java.util.List<java.lang.Object> assertions)
                                            throws MessageContentException,
                                                   MessageProcessingException
        Method to generate a FetchHardTokenDataRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenSerial - The unique serial number of the hard token within the organisation
        relatedCredentialIssuerId - The unique id of the issuer of the related credential, usually the subject DN name of the issuer.
        adminCredential - the credential of the requesting card administrator that need the hard token data. The response data is encrypted with this administrator as recipient.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genFetchHardTokenDataResponse

        public CSMessageResponseData genFetchHardTokenDataResponse​(java.lang.String relatedEndEntity,
                                                                   CSMessage request,
                                                                   java.lang.String tokenSerial,
                                                                   byte[] encryptedData,
                                                                   java.util.List<java.lang.Object> assertions)
                                                            throws MessageContentException,
                                                                   MessageProcessingException
        Method to generate a FetchHardTokenDataResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        tokenSerial - The unique serial number of the hard token within the organisation.
        encryptedData - The token data encrypted with the token administrators credential sent in the request.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRecoverHardTokenRequest

        public byte[] genRecoverHardTokenRequest​(java.lang.String requestId,
                                                 java.lang.String destinationId,
                                                 java.lang.String organisation,
                                                 java.lang.String tokenSerial,
                                                 java.lang.String relatedCredentialIssuerId,
                                                 Credential adminCredential,
                                                 Credential originator,
                                                 java.util.List<java.lang.Object> assertions)
                                          throws MessageContentException,
                                                 MessageProcessingException
        Method to generate a RecoverHardTokenDataRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenSerial - The unique serial number of the hard token within the organisation
        relatedCredentialIssuerId - The unique id of the issuer of the related credential, usually the subject DN name of the issuer.
        adminCredential - the credential of the requesting card administrator that need the hard token data. The response data is encrypted with this administrator as recipient.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRecoverHardTokenResponse

        public CSMessageResponseData genRecoverHardTokenResponse​(java.lang.String relatedEndEntity,
                                                                 CSMessage request,
                                                                 java.lang.String tokenSerial,
                                                                 byte[] encryptedData,
                                                                 java.util.List<Key> keys,
                                                                 java.util.List<java.lang.Object> assertions)
                                                          throws MessageContentException,
                                                                 MessageProcessingException
        Method to generate a RecoverHardTokenResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        tokenSerial - The unique serial number of the hard token within the organisation.
        encryptedData - The token data encrypted with the token administrators credential sent in the request.
        keys - list of encrypted keys recovered from frontend system.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genStoreHardTokenDataRequest

        public byte[] genStoreHardTokenDataRequest​(java.lang.String requestId,
                                                   java.lang.String destinationId,
                                                   java.lang.String organisation,
                                                   java.lang.String tokenSerial,
                                                   java.lang.String relatedCredentialIssuerId,
                                                   byte[] encryptedData,
                                                   Credential originator,
                                                   java.util.List<java.lang.Object> assertions)
                                            throws MessageContentException,
                                                   MessageProcessingException
        Method to generate a StoreHardTokenDataRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        tokenSerial - The unique serial number of the hard token within the organisation
        relatedCredentialIssuerId - The unique id of the issuer of the related credential, usually the subject DN name of the issuer.
        encryptedData - The token data encrypted with a credential provided out-of-bands by the CS administrator to protect the data during transport.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genStoreHardTokenDataResponse

        public CSMessageResponseData genStoreHardTokenDataResponse​(java.lang.String relatedEndEntity,
                                                                   CSMessage request,
                                                                   java.util.List<java.lang.Object> assertions)
                                                            throws MessageContentException,
                                                                   MessageProcessingException
        Method to generate a StoreHardTokenDataResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetTokensRequest

        public byte[] genGetTokensRequest​(java.lang.String requestId,
                                          java.lang.String destinationId,
                                          java.lang.String organisation,
                                          java.lang.String serialNumber,
                                          boolean exactMatch,
                                          Credential originator,
                                          java.util.List<java.lang.Object> assertions)
                                   throws MessageContentException,
                                          MessageProcessingException
        Method to generate a GetTokensRequest without pagination used in 2.0 protocol
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        serialNumber - The unique serial number of the hard token within the organisation, complete or part of the serial number
        exactMatch - If only exactly matching tokens should be fetched.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetTokensRequest

        public byte[] genGetTokensRequest​(java.lang.String requestId,
                                          java.lang.String destinationId,
                                          java.lang.String organisation,
                                          java.lang.String serialNumber,
                                          boolean exactMatch,
                                          java.lang.Integer startIndex,
                                          java.lang.Integer resultSize,
                                          Credential originator,
                                          java.util.List<java.lang.Object> assertions)
                                   throws MessageContentException,
                                          MessageProcessingException
        Method to generate a GetTokensRequest with pagination support (2.1)
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        serialNumber - The unique serial number of the hard token within the organisation, complete or part of the serial number
        exactMatch - If only exactly matching tokens should be fetched.
        startIndex - the index to fetch the resulting user data.
        resultSize - the maximum number of entries to return, should not be larger that the maximum setting in server.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetTokensResponse

        public CSMessageResponseData genGetTokensResponse​(java.lang.String relatedEndEntity,
                                                          CSMessage request,
                                                          java.util.List<Token> tokens,
                                                          java.util.List<java.lang.Object> assertions)
                                                   throws MessageContentException,
                                                          MessageProcessingException
        Method to generate a GetTokensResponse, used for 2.0 messages.
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        tokens - a list of matching tokens, never null.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetTokensResponse

        public CSMessageResponseData genGetTokensResponse​(java.lang.String relatedEndEntity,
                                                          CSMessage request,
                                                          java.util.List<Token> tokens,
                                                          java.lang.Integer startIndex,
                                                          java.lang.Integer totalMatching,
                                                          java.util.List<java.lang.Object> assertions)
                                                   throws MessageContentException,
                                                          MessageProcessingException
        Method to generate a GetTokensResponse used for pagination (pagination elements are only populated if request is 2.1 or above
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        tokens - a list of matching tokens, never null.
        startIndex - the start index of the page in the result set. Is only set if request is 2.1 or above
        totalMatching - the total matching users in query. Is only set if request is 2.1 or above
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetUsersRequest

        public byte[] genGetUsersRequest​(java.lang.String requestId,
                                         java.lang.String destinationId,
                                         java.lang.String organisation,
                                         java.lang.String uniqueId,
                                         boolean exactMatch,
                                         Credential originator,
                                         java.util.List<java.lang.Object> assertions)
                                  throws MessageContentException,
                                         MessageProcessingException
        Method to generate a GetUsersRequest without pagination used in 2.0 protocol
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        uniqueId - The unique id of the user within the organisation, complete or part of the unique id to search for
        exactMatch - If only exactly matching tokens should be fetched.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetUsersRequest

        public byte[] genGetUsersRequest​(java.lang.String requestId,
                                         java.lang.String destinationId,
                                         java.lang.String organisation,
                                         java.lang.String uniqueId,
                                         boolean exactMatch,
                                         java.lang.Integer startIndex,
                                         java.lang.Integer resultSize,
                                         Credential originator,
                                         java.util.List<java.lang.Object> assertions)
                                  throws MessageContentException,
                                         MessageProcessingException
        Method to generate a GetUsersRequest with pagination support (2.1)
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        uniqueId - The unique id of the user within the organisation, complete or part of the unique id to search for
        exactMatch - If only exactly matching tokens should be fetched.
        startIndex - the index to fetch the resulting user data.
        resultSize - the maximum number of entries to return, should not be larger that the maximum setting in server.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetUsersResponse

        public CSMessageResponseData genGetUsersResponse​(java.lang.String relatedEndEntity,
                                                         CSMessage request,
                                                         java.util.List<User> users,
                                                         java.util.List<java.lang.Object> assertions)
                                                  throws MessageContentException,
                                                         MessageProcessingException
        Method to generate a GetUsersResponse, used for 2.0 messages.
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        users - a list of matching users, never null.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetUsersResponse

        public CSMessageResponseData genGetUsersResponse​(java.lang.String relatedEndEntity,
                                                         CSMessage request,
                                                         java.util.List<User> users,
                                                         java.lang.Integer startIndex,
                                                         java.lang.Integer totalMatching,
                                                         java.util.List<java.lang.Object> assertions)
                                                  throws MessageContentException,
                                                         MessageProcessingException
        Method to generate a GetUsersResponse used for pagination (pagination elements are only populated if request is 2.1 or above
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        users - a list of matching users, never null.
        startIndex - the start index of the page in the result set. Is only set if request is 2.1 or above
        totalMatching - the total matching users in query. Is only set if request is 2.1 or above
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRecoverKeyRequest

        public byte[] genRecoverKeyRequest​(java.lang.String requestId,
                                           java.lang.String destinationId,
                                           java.lang.String organisation,
                                           Credential adminCredential,
                                           java.util.List<Credential> relatedCredentials,
                                           Credential originator,
                                           java.util.List<java.lang.Object> assertions)
                                    throws MessageContentException,
                                           MessageProcessingException
        Method to generate a RecoverKeyRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        adminCredential - the admin credential to encrypt the key store data to.
        relatedCredentials - the credentials pointing out which keys should be recovered from frontend store.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genRecoverKeyResponse

        public CSMessageResponseData genRecoverKeyResponse​(java.lang.String relatedEndEntity,
                                                           CSMessage request,
                                                           java.util.List<Key> keys,
                                                           java.util.List<java.lang.Object> assertions)
                                                    throws MessageContentException,
                                                           MessageProcessingException
        Method to generate a RecoverKeyResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        keys - a list of recovered keys, never null.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genStoreKeyRequest

        public byte[] genStoreKeyRequest​(java.lang.String requestId,
                                         java.lang.String destinationId,
                                         java.lang.String organisation,
                                         java.util.List<Key> keys,
                                         Credential originator,
                                         java.util.List<java.lang.Object> assertions)
                                  throws MessageContentException,
                                         MessageProcessingException
        Method to generate a StoreKeyRequest
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        keys - a list en encrypted keys to store in frontend system.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genStoreKeyResponse

        public CSMessageResponseData genStoreKeyResponse​(java.lang.String relatedEndEntity,
                                                         CSMessage request,
                                                         java.util.List<java.lang.Object> assertions)
                                                  throws MessageContentException,
                                                         MessageProcessingException
        Method to generate a StoreKeyResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialAvailableActionsRequest

        public byte[] genGetCredentialAvailableActionsRequest​(java.lang.String requestId,
                                                              java.lang.String destinationId,
                                                              java.lang.String organisation,
                                                              java.lang.String issuerId,
                                                              java.lang.String serialNumber,
                                                              java.lang.String locale,
                                                              Credential originator,
                                                              java.util.List<java.lang.Object> assertions)
                                                       throws MessageContentException,
                                                              MessageProcessingException
        Method to generate a GetCredentialAvailableActionsRequest to get available renewal action available for a given certificate.
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        issuerId - The unique id of the issuer, usually the subject DN name of the issuer.
        serialNumber - The serial number of the credential in hexadecimal encoding lowercase (for X509 certificates).
        locale - the locale in BCP 47 string, i.e en or en_GB or se_SV
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genGetCredentialAvailableActionsResponse

        public CSMessageResponseData genGetCredentialAvailableActionsResponse​(java.lang.String relatedEndEntity,
                                                                              CSMessage request,
                                                                              java.util.List<CredentialAvailableActionsOperation> operations,
                                                                              java.util.List<java.lang.Object> assertions)
                                                                       throws MessageContentException,
                                                                              MessageProcessingException
        Method to generate a GetCredentialAvailableActionsResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        operations - a list of operations that is available for a given credential when renewing.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genAutomaticRenewCredentialRequest

        public byte[] genAutomaticRenewCredentialRequest​(java.lang.String requestId,
                                                         java.lang.String destinationId,
                                                         java.lang.String organisation,
                                                         AutomationLevel automationLevel,
                                                         java.util.List<byte[]> renewalRequestData,
                                                         Credential originator,
                                                         java.util.List<java.lang.Object> assertions)
                                                  throws MessageContentException,
                                                         MessageProcessingException
        Method to generate a AutomaticRenewCredentialRequest to renew a given credential with an identical credential and used for automation steps.
        Parameters:
        requestId - the id of the request
        destinationId - the destinationId used in the CSMessage.
        organisation - the related organisation
        automationLevel - The level of automation, AUTOMATIC if requesting system updates automatically, or MANUAL of manual steps needs to be taked for renewal
        renewalRequestData - A list of request data. The request data is PKCS7 of PKCS10 data signed with original certificate.
        originator - the original requester of a message, null if not applicable.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genAutomaticRenewCredentialResponse

        public CSMessageResponseData genAutomaticRenewCredentialResponse​(java.lang.String relatedEndEntity,
                                                                         CSMessage request,
                                                                         java.util.List<AutomaticRenewCredentialResponse.RenewedCredential> renewedCredentials,
                                                                         java.util.List<java.lang.Object> assertions)
                                                                  throws MessageContentException,
                                                                         MessageProcessingException
        Method to generate a AutomaticRenewalResponse
        Parameters:
        relatedEndEntity - the name of the related end entity (such as username of the related user)
        request - the request this message is a response to.
        renewedCredentials - a list of renewed credential with a reference to the unique id of the original credential.
        assertions - a list of related authorization assertions, or null if no authorization assertions is available.
        Returns:
        a generated message.
        Throws:
        MessageContentException - if CS message contained invalid data not conforming to the standard.
        MessageProcessingException - if internal state occurred when processing the CSMessage
      • genKey

        public Key genKey​(Credential relatedCredential,
                          byte[] encryptedKey)
        Help method to generate a Key structure consisting of a relatedCredential and an encryptedKey.
        Parameters:
        relatedCredential - the related credential to the key.
        encryptedKey - the key in xml encrypted base64binary string.
        Returns:
        a newly generate key.
      • genRecoverableKey

        public RecoverableKey genRecoverableKey​(int relatedCredentialRequestId,
                                                byte[] encryptedKey)
        Help method to generate a RecoverableKey structure consisting of a relatedCredentialRequestId and an encryptedKey.
        Parameters:
        relatedCredentialRequestId - reference to the credential request id.
        encryptedKey - the key in xml encrypted base64binary string.
        Returns:
        a newly generate key.