be.ehealth.business.mycarenetcommons.builders.util

## Class BlobUtil

- java.lang.Object
- - be.ehealth.business.mycarenetcommons.builders.util.BlobUtil

- All Implemented Interfaces:
    ConfigurationModuleBootstrap.ModuleBootstrapHook

      public class BlobUtil
      extends Object
      implements ConfigurationModuleBootstrap.ModuleBootstrapHook

  provide 2 methods to help the xades management of the content. a simple method to get a xades signature on a content a more complex method that take the content, a provided xades (can be null) and a mandatory projectName if you use this one and if you want a signature, you have to can retrieve a true value in properties file. in this case, if provided xades is not null, it's this value that will be use

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlobUtil()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bootstrap()`
    `static byte[]` | `generateXades(Blob blob, String projectName)`
    `static byte[]` | `generateXades(Blob blob, String projectName, String platformName)`
    `static Base64Binary` | `generateXades(BlobType inValue)` generates the xades based on the content of the blob.
    `static Base64Binary` | `generateXades(BlobType inValue, byte[] furnishedXades, String projectName)` generates the xades based on the content of the blob.
    `static Base64Binary` | `generateXades(BlobType inValue, byte[] furnishedXades, String projectName)`
    `static Base64Binary` | `generateXades(BlobType inValue, String projectName)`
    `static Base64Binary` | `generateXades(BlobType inValue, String projectName)`
    `static Base64Binary` | `generateXades(BlobType inValue, String projectName, String platformName)` generates a xades value as defined for the project.
    `static Base64Binary` | `generateXadesForBlob(Blob inValue)` generates the xades based on the content of the blob.
    `static Base64Binary` | `generateXadesForBlob(Blob blob, byte[] furnishedXades, String projectName)` generates the xades based on the content of the blob.
    `static Base64Binary` | `generateXadesForBlob(Blob blob, String projectName)` generates the xades based on the content of the blob.
    `static Base64Binary` | `generateXadesForBlob(Blob blob, String projectName, String platformName)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BlobUtil

          public BlobUtil()

  - ### Method Detail

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue,
                                                   byte[] furnishedXades,
                                                   String projectName)
                                            throws TechnicalConnectorException

      generates the xades based on the content of the blob. it needs the Blobtype as input , because the signature generator will search the xml tree for a tag with a given id ( inValue.getId ) to find the content to sign. the signing is also influence by the encoding of the content ( which we give to the signer in the transformList )

      transformers used : see documentation :

           The reference must contain one or several of following transforms, in the below order:
           •   “http://www.w3.org/2000/09/xmldsig#base64”: to base64 decode the content of the message (always needed).
           •   “urn:nippin:xml:sig:transform:optional-deflate” to deflate the content of the message (needed if the content is deflated, i.e. for Async flows)
           •   “http://www.w3.org/2001/10/xml-exc-c14n#” in case the content is XML and no other formats like text or pdf.

      Parameters:
        `inValue` - blob to sign
        `furnishedXades` - xades provided by the requester
        `projectName` - : name of the project needed in the properties
      Returns:
        Base64Binary xades in base64Binary format
      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue,
                                                   byte[] furnishedXades,
                                                   String projectName)
                                            throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### generateXadesForBlob

          public static Base64Binary generateXadesForBlob(Blob blob,
                                                          byte[] furnishedXades,
                                                          String projectName)
                                                   throws TechnicalConnectorException

      generates the xades based on the content of the blob. it needs the Blobtype as input , because the signature generator will search the xml tree for a tag with a given id ( inValue.getId ) to find the content to sign. the signing is also influence by the encoding of the content ( which we give to the signer in the transformList )

      transformers used : see documentation :

           The reference must contain one or several of following transforms, in the below order:
           •   “http://www.w3.org/2000/09/xmldsig#base64”: to base64 decode the content of the message (always needed).
           •   “urn:nippin:xml:sig:transform:optional-deflate” to deflate the content of the message (needed if the content is deflated, i.e. for Async flows)
           •   “http://www.w3.org/2001/10/xml-exc-c14n#” in case the content is XML and no other formats like text or pdf.

      Parameters:
        `blob` - blob to sign
        `furnishedXades` - xades provided by the requester
        `projectName` - : name of the project needed in the properties
      Returns:
        Base64Binary xades in base64Binary format
      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static byte[] generateXades(Blob blob,
                                             String projectName,
                                             String platformName)
                                      throws TechnicalConnectorException

      Parameters:
        `blob` - blob to sign
        `projectName` - : name of the project needed in the properties
        `platformName` - : name of the platform (mycarenet, vsbnet, etc..., needed in the properties
      Returns:
        the base64 xades value as byte array
      Throws:
        `TechnicalConnectorException`
      See Also:
        `generateXadesForBlob(Blob, byte[], String)`

    - #### generateXades

          public static byte[] generateXades(Blob blob,
                                             String projectName)
                                      throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue)
                                            throws TechnicalConnectorException

      generates the xades based on the content of the blob. it needs the Blobtype as input , because the signature generator will search the xml tree for a tag with a given id ( inValue.getId ) to find the content to sign. the signing is also influence by the encoding of the content ( which we give to the signer in the transformList )
      Configuration : will use property mycarenet.default.request.xadestype , more info see generateXades(BlobType inValue, String projectName)

      transformers used : see documentation :

           The reference must contain one or several of following transforms, in the below order:
           •   'http://www.w3.org/2000/09/xmldsig#base64': to base64 decode the content of the message (always needed).
           •   'urn:nippin:xml:sig:transform:optional-deflate' to deflate the content of the message (needed if the content is deflated, i.e. for Async flows)
           •   'http://www.w3.org/2001/10/xml-exc-c14n#' in case the content is XML and no other formats like text or pdf.

      Parameters:
        `inValue` - to sign
      Returns:
        signature xades in base64Binary format
      Throws:
        `TechnicalConnectorException`

    - #### generateXadesForBlob

          public static Base64Binary generateXadesForBlob(Blob inValue)
                                                   throws TechnicalConnectorException

      generates the xades based on the content of the blob. it needs the Blobtype as input , because the signature generator will search the xml tree for a tag with a given id ( inValue.getId ) to find the content to sign. the signing is also influence by the encoding of the content ( which we give to the signer in the transformList )
      Configuration : will use property mycarenet.default.request.xadestype , more info see generateXades(BlobType inValue, String projectName)

      transformers used : see documentation :

           The reference must contain one or several of following transforms, in the below order:
           •   'http://www.w3.org/2000/09/xmldsig#base64': to base64 decode the content of the message (always needed).
           •   'urn:nippin:xml:sig:transform:optional-deflate' to deflate the content of the message (needed if the content is deflated, i.e. for Async flows)
           •   'http://www.w3.org/2001/10/xml-exc-c14n#' in case the content is XML and no other formats like text or pdf.

      Parameters:
        `inValue` - to sign
      Returns:
        signature xades in base64Binary format
      Throws:
        `TechnicalConnectorException`

    - #### generateXadesForBlob

          public static Base64Binary generateXadesForBlob(Blob blob,
                                                          String projectName)
                                                   throws TechnicalConnectorException

      generates the xades based on the content of the blob. it needs the Blobtype as input , because the signature generator will search the xml tree for a tag with a given id ( inValue.getId ) to find the content to sign. the signing is also influence by the encoding of the content ( which we give to the signer in the transformList )
      Configuration : will use property mycarenet.default.request.xadestype , more info see generateXades(BlobType inValue, String projectName)

      transformers used : see documentation :

           The reference must contain one or several of following transforms, in the below order:
           •   'http://www.w3.org/2000/09/xmldsig#base64': to base64 decode the content of the message (always needed).
           •   'urn:nippin:xml:sig:transform:optional-deflate' to deflate the content of the message (needed if the content is deflated, i.e. for Async flows)
           •   'http://www.w3.org/2001/10/xml-exc-c14n#' in case the content is XML and no other formats like text or pdf.

      Parameters:
        `blob` - Blob to sign
        `projectName` - the name of the project ( needed to retrieve config properties )
      Returns:
        signature xades in base64Binary format
      Throws:
        `TechnicalConnectorException`

    - #### generateXadesForBlob

          public static Base64Binary generateXadesForBlob(Blob blob,
                                                          String projectName,
                                                          String platformName)
                                                   throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue,
                                                   String projectName,
                                                   String platformName)
                                            throws TechnicalConnectorException

      generates a xades value as defined for the project. configProperty : mycarenet.{projectName}.request.xadestype , with value xades or xadest default = defined in mycarenet.default.request.xadestype
      Parameters:
        `inValue` -
        `projectName` -
      Returns:
      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue,
                                                   String projectName)
                                            throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### generateXades

          public static Base64Binary generateXades(BlobType inValue,
                                                   String projectName)
                                            throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### bootstrap

          public void bootstrap()

      Specified by:
        `bootstrap` in interface `ConfigurationModuleBootstrap.ModuleBootstrapHook`

Connector Packaging TRUSSMAKER 4.0.2 API
Copyright © {inceptionYear}-2021 eHealth. All Rights Reserved.