Package pt.gov.cartaodecidadao
Class PTEID_CMDSignatureClient
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_CMDSignatureClient
- All Implemented Interfaces:
PTEID_SigningDevice
This class is a client for signing with Chave Móvel Digital.
- Since:
- 3.8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()getCA()getCert(PTEID_CertifType type) This method returns the certificates for the account used in the last signature performed by this client.
If no signature was made, it will open a dialog to introduce the CMD credentials for the account of the
certificates to be obtained.getRoot()longstatic voidsetCredentials(String basicAuthUser, String basicAuthPassword, String applicationId) Set the credentials for the CMD services.
The credentials must be set once before using the CMD services and will be used for every instance of
PTEID_CMDSignatureClient.voidsetMobileNumberCaching(boolean enabled) If setMobileNumberCaching is enabled, the mobile number used in a previous signature with this instance is
cached and displayed in the signature dialog as a placeholder.Sign(PTEID_ByteArray data)
The PTEID_CMDSignatureClient class only supports signature key.Sign(PTEID_ByteArray data, boolean signatureKey)
The PTEID_CMDSignatureClient class only supports signature key.voidvoidSignASiC(String path, PTEID_SignatureLevel level) intSignPDF(PTEID_PDFSignature sig_handler, int page, double coord_x, double coord_y, String location, String reason, String outfile_path) intSignPDF(PTEID_PDFSignature sig_handler, int page, int page_sector, boolean is_landscape, String location, String reason, String outfile_path) SignSHA256(PTEID_ByteArray data) Deprecated.SignSHA256(PTEID_ByteArray data, boolean signatureKey) Deprecated.Use PTEID_CMDSignatureClient::Sign instead.
The PTEID_CMDSignatureClient class only supports signature key.SignXades(String output_path, String[] paths, long n_paths, PTEID_SignatureLevel level) SignXadesA(String output_path, String[] paths, long n_paths) Warning: This method is not implemented for PTEID_CMDSignatureClient.voidSignXadesAIndividual(String output_path, String[] paths, long n_paths) Warning: This method is not implemented for PTEID_CMDSignatureClient.voidSignXadesIndividual(String output_path, String[] paths, long n_paths) Warning: This method is not implemented for PTEID_CMDSignatureClient.SignXadesT(String output_path, String[] paths, long n_paths) Warning: This method is not implemented for PTEID_CMDSignatureClient.voidSignXadesTIndividual(String output_path, String[] paths, long n_paths) Warning: This method is not implemented for PTEID_CMDSignatureClient.
-
Constructor Details
-
PTEID_CMDSignatureClient
public PTEID_CMDSignatureClient()Default constructor
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Object
-
PTEID_SigningDevice_GetInterfaceCPtr
public long PTEID_SigningDevice_GetInterfaceCPtr()- Specified by:
PTEID_SigningDevice_GetInterfaceCPtrin interfacePTEID_SigningDevice
-
setMobileNumberCaching
public void setMobileNumberCaching(boolean enabled) If setMobileNumberCaching is enabled, the mobile number used in a previous signature with this instance is
cached and displayed in the signature dialog as a placeholder. -
Sign
The PTEID_CMDSignatureClient class only supports signature key. For that reason, signatureKey must be
set to true!- Specified by:
Signin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
Sign
The PTEID_CMDSignatureClient class only supports signature key. For that reason, signatureKey must be
set to true!- Specified by:
Signin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignSHA256
public PTEID_ByteArray SignSHA256(PTEID_ByteArray data, boolean signatureKey) throws PTEID_Exception Deprecated.Use PTEID_CMDSignatureClient::Sign instead.
The PTEID_CMDSignatureClient class only supports signature key. For that reason, signatureKey must be
set to true!- Specified by:
SignSHA256in interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignSHA256
Deprecated.Use PTEID_CMDSignatureClient::Sign instead.
The PTEID_CMDSignatureClient class only supports signature key. For that reason, signatureKey must be
set to true!- Specified by:
SignSHA256in interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXades
public PTEID_ByteArray SignXades(String output_path, String[] paths, long n_paths, PTEID_SignatureLevel level) throws PTEID_Exception - Specified by:
SignXadesin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXades
public PTEID_ByteArray SignXades(String output_path, String[] paths, long n_paths) throws PTEID_Exception - Specified by:
SignXadesin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXadesT
public PTEID_ByteArray SignXadesT(String output_path, String[] paths, long n_paths) throws PTEID_Exception Warning: This method is not implemented for PTEID_CMDSignatureClient.- Specified by:
SignXadesTin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXadesA
public PTEID_ByteArray SignXadesA(String output_path, String[] paths, long n_paths) throws PTEID_Exception Warning: This method is not implemented for PTEID_CMDSignatureClient.- Specified by:
SignXadesAin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXadesIndividual
public void SignXadesIndividual(String output_path, String[] paths, long n_paths) throws PTEID_Exception Warning: This method is not implemented for PTEID_CMDSignatureClient.- Specified by:
SignXadesIndividualin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXadesTIndividual
public void SignXadesTIndividual(String output_path, String[] paths, long n_paths) throws PTEID_Exception Warning: This method is not implemented for PTEID_CMDSignatureClient.- Specified by:
SignXadesTIndividualin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignXadesAIndividual
public void SignXadesAIndividual(String output_path, String[] paths, long n_paths) throws PTEID_Exception Warning: This method is not implemented for PTEID_CMDSignatureClient.- Specified by:
SignXadesAIndividualin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignASiC
- Specified by:
SignASiCin interfacePTEID_SigningDevice
-
SignASiC
- Specified by:
SignASiCin interfacePTEID_SigningDevice
-
SignPDF
public int SignPDF(PTEID_PDFSignature sig_handler, int page, int page_sector, boolean is_landscape, String location, String reason, String outfile_path) throws PTEID_Exception - Specified by:
SignPDFin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
SignPDF
public int SignPDF(PTEID_PDFSignature sig_handler, int page, double coord_x, double coord_y, String location, String reason, String outfile_path) throws PTEID_Exception - Specified by:
SignPDFin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getCertificates
This method returns the certificates for the account used in the last signature performed by this client.
If no signature was made, it will open a dialog to introduce the CMD credentials for the account of the
certificates to be obtained.- Specified by:
getCertificatesin interfacePTEID_SigningDevice- Returns:
- an object to access the certificate chain of a CMD account.
Warning: The PTEID_CMDSignatureClient instance manages the allocation and deletion of the PTEID_Certificates
returned by getCertificates(). This means that the PTEID_Certificates can only be used while the
PTEID_CMDSignatureClient exists (in Java/C# be sure to keep a reference to PTEID_CMDSignatureClient!). - Throws:
PTEID_Exception
-
getCert
- Specified by:
getCertin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getRoot
- Specified by:
getRootin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getCA
- Specified by:
getCAin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getSignature
- Specified by:
getSignaturein interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getAuthentication
- Specified by:
getAuthenticationin interfacePTEID_SigningDevice- Throws:
PTEID_Exception
-
getDeviceType
- Specified by:
getDeviceTypein interfacePTEID_SigningDevice
-
setCredentials
public static void setCredentials(String basicAuthUser, String basicAuthPassword, String applicationId) Set the credentials for the CMD services.
The credentials must be set once before using the CMD services and will be used for every instance of
PTEID_CMDSignatureClient.
-
The PTEID_CMDSignatureClient class only supports signature key.