Package es.gob.afirma.integraFacade
Class IntegraFacadeBind
- java.lang.Object
-
- es.gob.afirma.integraFacade.IntegraFacadeBind
-
public final class IntegraFacadeBind extends java.lang.ObjectClass to bind protected methods of IntegraFacade.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.2, 14/03/2017.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]generateCoSignature(java.lang.String signatureTypeParam, byte[] signature, byte[] signedData, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient)Method that generates a co-signature.static byte[]generateCounterSignature(java.lang.String signatureTypeParam, byte[] signature, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient)Method that generates a counter-signature over a signature.static byte[]generateMultiSignaturePAdESRubric(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, byte[] image, java.lang.String imagePage, int lowerLeftX, int lowerLeftY, int upperRightX, int upperRightY, java.lang.String idClient)Method that generates a multi-signature with rubric.static byte[]generateSignature(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient)Method that generates a signature.static byte[]generateSignaturePAdESRubric(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, byte[] image, java.lang.String imagePage, int lowerLeftX, int lowerLeftY, int upperRightX, int upperRightY, java.lang.String idClient)Method that generates a signature with rubric.static byte[]upgradeSignature(byte[] signature, java.util.List<java.security.cert.X509Certificate> listSigners, java.lang.String idClient)Method that upgrades a signature adding a timestamp to all of the signers indicated.static java.lang.ObjectverifySignature(byte[] signature, byte[] signedData, java.lang.String idClient)Method that validates the signers of a signature.
-
-
-
Method Detail
-
generateSignature
public static byte[] generateSignature(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient) throws SigningExceptionMethod that generates a signature.- Parameters:
signatureTypeParam- Parameter that represents signature type.dataToSign- Parameter that represents the data to sign.privateKey- Parameter that represents the private key of the signing certificate.includeSignaturePolicy- Parameter that indicates if to include signature policy into the signature (true) or not (false).includeTimestamp- Parameter that indicates if to add a timestamp to the signature (true) or not (false).idClient- client identifier of ws invocation.- Returns:
- a signature with one of the next formats:
ISignatureFormatDetector.FORMAT_CADES_BESISignatureFormatDetector.FORMAT_CADES_EPESISignatureFormatDetector.FORMAT_CADES_TISignatureFormatDetector.FORMAT_XADES_BESISignatureFormatDetector.FORMAT_XADES_EPESISignatureFormatDetector.FORMAT_XADES_TISignatureFormatDetector.FORMAT_PADES_BESISignatureFormatDetector.FORMAT_PADES_EPESISignatureFormatDetector.FORMAT_CADES_B_LEVELISignatureFormatDetector.FORMAT_XADES_B_LEVELISignatureFormatDetector.FORMAT_PADES_B_LEVELISignatureFormatDetector.FORMAT_CADES_T_LEVELISignatureFormatDetector.FORMAT_XADES_T_LEVELISignatureFormatDetector.FORMAT_PADES_T_LEVEL
- Throws:
SigningException- If the method fails.
-
generateCoSignature
public static byte[] generateCoSignature(java.lang.String signatureTypeParam, byte[] signature, byte[] signedData, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient) throws SigningExceptionMethod that generates a co-signature.- Parameters:
signatureTypeParam- Parameter that represents signature type.signature- Parameter that represents the signature to co-sign.signedData- Parameter that represents the data to sign.privateKey- Parameter that represents the private key of the signing certificate.includeSignaturePolicy- Parameter that indicates if to include signature policy into the co-signature (true) or not (false).includeTimestamp- Parameter that indicates if to add a timestamp to the co-signature (true) or not (false).idClient- client identifier of ws invocation.- Returns:
- a co-signature with one of the next formats:
ISignatureFormatDetector.FORMAT_CADES_BESISignatureFormatDetector.FORMAT_CADES_EPESISignatureFormatDetector.FORMAT_CADES_TISignatureFormatDetector.FORMAT_XADES_BESISignatureFormatDetector.FORMAT_XADES_EPESISignatureFormatDetector.FORMAT_XADES_TISignatureFormatDetector.FORMAT_PADES_BESISignatureFormatDetector.FORMAT_PADES_EPESISignatureFormatDetector.FORMAT_CADES_B_LEVELISignatureFormatDetector.FORMAT_XADES_B_LEVELISignatureFormatDetector.FORMAT_PADES_B_LEVELISignatureFormatDetector.FORMAT_CADES_T_LEVELISignatureFormatDetector.FORMAT_XADES_T_LEVELISignatureFormatDetector.FORMAT_PADES_T_LEVEL
- Throws:
SigningException- If the method fails.
-
generateCounterSignature
public static byte[] generateCounterSignature(java.lang.String signatureTypeParam, byte[] signature, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, java.lang.String idClient) throws SigningExceptionMethod that generates a counter-signature over a signature.- Parameters:
signatureTypeParam- Parameter that represents signature type.signature- Parameter that represents the signature to counter-sign.privateKey- Parameter that represents the private key of the signing certificate.includeSignaturePolicy- Parameter that indicates if to include signature policy into the co-signature (true) or not (false).includeTimestamp- Parameter that indicates if to add a timestamp to the co-signature (true) or not (false).idClient- client identifier of ws invocation.- Returns:
- a signature with a counter-signature with one of the next formats:
ISignatureFormatDetector.FORMAT_CADES_BESISignatureFormatDetector.FORMAT_CADES_EPESISignatureFormatDetector.FORMAT_CADES_TISignatureFormatDetector.FORMAT_XADES_BESISignatureFormatDetector.FORMAT_XADES_EPESISignatureFormatDetector.FORMAT_XADES_TISignatureFormatDetector.FORMAT_PADES_BESISignatureFormatDetector.FORMAT_PADES_EPESISignatureFormatDetector.FORMAT_CADES_B_LEVELISignatureFormatDetector.FORMAT_XADES_B_LEVELISignatureFormatDetector.FORMAT_PADES_B_LEVELISignatureFormatDetector.FORMAT_CADES_T_LEVELISignatureFormatDetector.FORMAT_XADES_T_LEVELISignatureFormatDetector.FORMAT_PADES_T_LEVEL
- Throws:
SigningException- If the method fails.
-
upgradeSignature
public static byte[] upgradeSignature(byte[] signature, java.util.List<java.security.cert.X509Certificate> listSigners, java.lang.String idClient) throws SigningExceptionMethod that upgrades a signature adding a timestamp to all of the signers indicated. If the list of signers is null or empty, the timestamp will be added to all of the signers of the signature. The timestamp will be added only to those signers that don't have a previous timestamp. If the signature has a PDF format (PAdES-Basic, PAdES-BES, PAdES-EPES or PAdES-LTV), this method adds a Document Time-stamp dictionary and the signature form will be PAdES-LTV.- Parameters:
signature- Parameter that represents the signature to upgrade.listSigners- Parameter that represents the list of signers of the signature to upgrade with a timestamp. Only for ASN.1 and XML signatures.idClient- client identifier of ws invocation.- Returns:
- the upgraded signature.
- Throws:
SigningException- If the method fails.
-
verifySignature
public static java.lang.Object verifySignature(byte[] signature, byte[] signedData, java.lang.String idClient)Method that validates the signers of a signature.- Parameters:
signature- Parameter that represents the signature to validate.signedData- Parameter that represents the original data signed by the signature.idClient- client identifier of web service invocation.- Returns:
- an object that contains the information about the validation result. The result must be an instance of:
ValidationResultfor ASN.1, XML and ASiC-S signatures.PDFValidationResultfor PDF signatures.
-
generateSignaturePAdESRubric
public static byte[] generateSignaturePAdESRubric(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, byte[] image, java.lang.String imagePage, int lowerLeftX, int lowerLeftY, int upperRightX, int upperRightY, java.lang.String idClient) throws SigningExceptionMethod that generates a signature with rubric.- Parameters:
signatureTypeParam- Parameter that represents signature type.dataToSign- Parameter that represents the data to sign.privateKey- Parameter that represents the private key of the signing certificate.includeSignaturePolicy- Parameter that indicates if to include signature policy into the signature (true) or not (false).includeTimestamp- Parameter that indicates if to add a timestamp to the signature (true) or not (false).image- Parameter that represents the image to be inserted as a rubric in the PDF.imagePage- Parameter that represents the page where the image will be inserted.lowerLeftX- Parameter that represents the coordinate horizontal lower left of the image position.lowerLeftY- Parameter that represents the coordinate vertically lower left of the image position.upperRightX- Parameter that represents the coordinate horizontal upper right of the image position.upperRightY- Parameter that represents the coordinate vertically upper right of the image position.idClient- client identifier of ws invocation.- Returns:
- a signature PAdES (Baseline or no)
- Throws:
SigningException- If the method fails.
-
generateMultiSignaturePAdESRubric
public static byte[] generateMultiSignaturePAdESRubric(java.lang.String signatureTypeParam, byte[] dataToSign, java.security.KeyStore.PrivateKeyEntry privateKey, boolean includeSignaturePolicy, boolean includeTimestamp, byte[] image, java.lang.String imagePage, int lowerLeftX, int lowerLeftY, int upperRightX, int upperRightY, java.lang.String idClient) throws SigningExceptionMethod that generates a multi-signature with rubric.- Parameters:
signatureTypeParam- Parameter that represents signature type.dataToSign- Parameter that represents the data to sign.privateKey- Parameter that represents the private key of the signing certificate.includeSignaturePolicy- Parameter that indicates if to include signature policy into the signature (true) or not (false).includeTimestamp- Parameter that indicates if to add a timestamp to the signature (true) or not (false).image- Parameter that represents the image to be inserted as a rubric in the PDF.imagePage- Parameter that represents the page where the image will be inserted.lowerLeftX- Parameter that represents the coordinate horizontal lower left of the image position.lowerLeftY- Parameter that represents the coordinate vertically lower left of the image position.upperRightX- Parameter that represents the coordinate horizontal upper right of the image position.upperRightY- Parameter that represents the coordinate vertically upper right of the image position.idClient- client identifier of ws invocation.- Returns:
- a signature PAdES (Baseline or no)
- Throws:
SigningException- If the method fails.
-
-