Class PTEID_SigningDeviceProxy

  • All Implemented Interfaces:
    PTEID_SigningDevice

    public class PTEID_SigningDeviceProxy
    extends java.lang.Object
    implements PTEID_SigningDevice
    Interface class for objects with Signing capabilities.
    Since:
    3.8.0
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void delete()  
      PTEID_Certificate getAuthentication()
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      PTEID_Certificate getCA()
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      PTEID_Certificate getCert​(PTEID_CertifType type)
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      PTEID_Certificates getCertificates()
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      PTEID_SigningDeviceType getDeviceType()
      Get type of SigningDeviceType.
      PTEID_Certificate getRoot()
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      PTEID_Certificate getSignature()
      Deprecated.
      Use getCertificates() to obtain the certificates and obtain the desired certificate/build the chain manually.
      long PTEID_SigningDevice_GetInterfaceCPtr()  
      PTEID_ByteArray Sign​(PTEID_ByteArray data)
      Raw RSA signature with PCKS #1 padding.
      PTEID_ByteArray Sign​(PTEID_ByteArray data, boolean signatureKey)
      Raw RSA signature with PCKS #1 padding.
      void SignASiC​(java.lang.String path)  
      void SignASiC​(java.lang.String path, PTEID_SignatureLevel level)  
      int SignPDF​(PTEID_PDFSignature sig_handler, int page, double coord_x, double coord_y, java.lang.String location, java.lang.String reason, java.lang.String outfile_path)
      PDF Signature with location by coordinates (expressed in percentage of page height/width).
      int SignPDF​(PTEID_PDFSignature sig_handler, int page, int page_sector, boolean is_landscape, java.lang.String location, java.lang.String reason, java.lang.String outfile_path)
      Deprecated.
      use the SignPDF function with location coordinates instead
      PTEID_ByteArray SignSHA256​(PTEID_ByteArray data)
      Deprecated.
      This method is now deprecated.
      PTEID_ByteArray SignSHA256​(PTEID_ByteArray data, boolean signatureKey)
      Deprecated.
      This method is now deprecated.
      PTEID_ByteArray SignXades​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Produce a XAdES Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format.
      PTEID_ByteArray SignXades​(java.lang.String output_path, java.lang.String[] paths, long n_paths, PTEID_SignatureLevel level)
      Produce a XAdES Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format.
      PTEID_ByteArray SignXadesA​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Deprecated.
      use the SignXades function and set signature level with level (PTEID_SignatureLevel) parameter instead
      void SignXadesAIndividual​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Produce XAdES-A Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.
      If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.
      If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a XAdES-LT or XAdES-LTA depending where the timestamping fails.

      void SignXadesIndividual​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Produce XAdES-B Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.

      PTEID_ByteArray SignXadesT​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Deprecated.
      use the SignXades function and set signature level with level (PTEID_SignatureLevel) parameter instead
      void SignXadesTIndividual​(java.lang.String output_path, java.lang.String[] paths, long n_paths)
      Produce XAdES-T Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.
      If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • delete

        public void delete()
      • Sign

        public PTEID_ByteArray Sign​(PTEID_ByteArray data,
                                    boolean signatureKey)
                             throws PTEID_Exception
        Raw RSA signature with PCKS #1 padding.
        Specified by:
        Sign in interface PTEID_SigningDevice
        Parameters:
        data - holds the data to be signed, at most 32 bytes. This data should be hashed using sha256.
        signatureKey - whether to use the 'Signature key'. By default, it uses the 'Authentication private key'. To sign with the 'Signature private key' set the parameter signatureKey to true.
        Returns:
        A PTEID_ByteArray containing the signed data.
        Throws:
        PTEID_Exception
      • SignSHA256

        public PTEID_ByteArray SignSHA256​(PTEID_ByteArray data,
                                          boolean signatureKey)
                                   throws PTEID_Exception
        Deprecated.
        This method is now deprecated. Use PTEID_SigningDevice::Sign method instead, which already supports SHA256.
        Raw RSA signature with PCKS #1 padding (applied to a SHA256 hash).
        Specified by:
        SignSHA256 in interface PTEID_SigningDevice
        Parameters:
        data - holds the data to be signed, it should be 32 bytes.
        signatureKey - whether to use the 'Signature key'. By default, it uses the 'Authentication private key'. To sign with the 'Signature private key' set the parameter signatureKey to true.
        Returns:
        A PTEID_ByteArray containing the signed data.
        Throws:
        PTEID_Exception
      • SignSHA256

        public PTEID_ByteArray SignSHA256​(PTEID_ByteArray data)
                                   throws PTEID_Exception
        Deprecated.
        This method is now deprecated. Use PTEID_SigningDevice::Sign method instead, which already supports SHA256.
        Raw RSA signature with PCKS #1 padding (applied to a SHA256 hash).
        Specified by:
        SignSHA256 in interface PTEID_SigningDevice
        Parameters:
        data - holds the data to be signed, it should be 32 bytes.

        Returns:
        A PTEID_ByteArray containing the signed data.
        Throws:
        PTEID_Exception
      • SignXades

        public PTEID_ByteArray SignXades​(java.lang.String output_path,
                                         java.lang.String[] paths,
                                         long n_paths,
                                         PTEID_SignatureLevel level)
                                  throws PTEID_Exception
        Produce a XAdES Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path.

        Specified by:
        SignXades in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - points to the resulting container
        level - is an enum used to set the XAdES signature level/profile: XAdES-B (PTEID_LEVEL_BASIC), XAdES-T (PTEID_LEVEL_T), XAdES-LTA (PTEID_LEVEL_LTV). Note: Setting parameter level to PTEID_LEVEL_LT will throw PTEID_Exception(EIDMW_ERR_PARAM_BAD), as it is not supported yet.
        Throws:
        PTEID_Exception
      • SignXades

        public PTEID_ByteArray SignXades​(java.lang.String output_path,
                                         java.lang.String[] paths,
                                         long n_paths)
                                  throws PTEID_Exception
        Produce a XAdES Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path.

        Specified by:
        SignXades in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - points to the resulting container
        Throws:
        PTEID_Exception
      • SignXadesT

        public PTEID_ByteArray SignXadesT​(java.lang.String output_path,
                                          java.lang.String[] paths,
                                          long n_paths)
                                   throws PTEID_Exception
        Deprecated.
        use the SignXades function and set signature level with level (PTEID_SignatureLevel) parameter instead
        Produce a XAdES-T Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path.
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.

        Specified by:
        SignXadesT in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - points to the resulting container
        Throws:
        PTEID_Exception
      • SignXadesA

        public PTEID_ByteArray SignXadesA​(java.lang.String output_path,
                                          java.lang.String[] paths,
                                          long n_paths)
                                   throws PTEID_Exception
        Deprecated.
        use the SignXades function and set signature level with level (PTEID_SignatureLevel) parameter instead
        Produce a XAdES-LTA Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path.
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.
        If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a XAdES-LT or XAdES-LTA depending where the timestamping fails.

        Specified by:
        SignXadesA in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - points to the resulting container
        Throws:
        PTEID_Exception
      • SignXadesIndividual

        public void SignXadesIndividual​(java.lang.String output_path,
                                        java.lang.String[] paths,
                                        long n_paths)
                                 throws PTEID_Exception
        Produce XAdES-B Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.

        Specified by:
        SignXadesIndividual in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - directory of the created ASiC containers
        Throws:
        PTEID_Exception
      • SignXadesTIndividual

        public void SignXadesTIndividual​(java.lang.String output_path,
                                         java.lang.String[] paths,
                                         long n_paths)
                                  throws PTEID_Exception
        Produce XAdES-T Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.

        Specified by:
        SignXadesTIndividual in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - directory of the created ASiC containers
        Throws:
        PTEID_Exception
      • SignXadesAIndividual

        public void SignXadesAIndividual​(java.lang.String output_path,
                                         java.lang.String[] paths,
                                         long n_paths)
                                  throws PTEID_Exception
        Produce XAdES-A Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.
        If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a XAdES-LT or XAdES-LTA depending where the timestamping fails.

        Specified by:
        SignXadesAIndividual in interface PTEID_SigningDevice
        Parameters:
        paths - is an array of null-terminated strings representing absolute paths in
        the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature
        n_paths - is the number of elements in the paths array
        output_path - directory of the created ASiC containers
        Throws:
        PTEID_Exception
      • SignPDF

        public int SignPDF​(PTEID_PDFSignature sig_handler,
                           int page,
                           int page_sector,
                           boolean is_landscape,
                           java.lang.String location,
                           java.lang.String reason,
                           java.lang.String outfile_path)
                    throws PTEID_Exception
        Deprecated.
        use the SignPDF function with location coordinates instead
        PDF Signature with location by page sector (the portrait A4 page is split into 18 cells: 6 lines and 3 columns)
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a PAdES-B signature.
        If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a PAdES-LT or PAdES-LTA depending where the timestamping fails.

        Specified by:
        SignPDF in interface PTEID_SigningDevice
        Parameters:
        sig_handler - : this defines the input file and some signature options
        page - : in case of visible signature it defines the page where the signature will appear
        page_sector - : position in the signature grid, between 1 to 18 for Portrait documents and 1 to 20 for Landscape ones
        is_landscape - : is unused parameter, the SDK now detects document orientation automatically
        location - : Signature metadata field
        reason - : Signature metadata field
        outfile_path - : Native Filesystem path of the ouput file
        Throws:
        PTEID_Exception
      • SignPDF

        public int SignPDF​(PTEID_PDFSignature sig_handler,
                           int page,
                           double coord_x,
                           double coord_y,
                           java.lang.String location,
                           java.lang.String reason,
                           java.lang.String outfile_path)
                    throws PTEID_Exception
        PDF Signature with location by coordinates (expressed in percentage of page height/width). The coordinate system has its origin in the top left corner of the page
        If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a PAdES-B signature.
        If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a PAdES-LT or PAdES-LTA depending where the timestamping fails.

        Specified by:
        SignPDF in interface PTEID_SigningDevice
        Parameters:
        sig_handler - : this defines the input file and some signature options
        page - : in case of visible signature it defines the page where the signature will appear
        coord_x - : X coordinate of the signature location (percentage of page width)
        coord_y - : Y coordinate of the signature location (percentage of page height)
        location - : Location field in the added signature metadata
        reason - : Signature metadata field
        outfile_path - : Native Filesystem path of the ouput file
        Throws:
        PTEID_Exception