public final class IntegraFacade
extends java.lang.Object
Class that represents the facade which manages the generation, validation, and upgrade of signatures.
Project:@Firma and TS@ Web Services Integration Platform.
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
generateCoSignature(byte[] signature,
byte[] signedData,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
Method that generates a co-signature.
|
static byte[] |
generateCounterSignature(byte[] signature,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
Method that generates a counter-signature over a signature.
|
static byte[] |
generateMultiSignaturePAdESRubric(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)
Method that generates a multi-signature with rubric.
|
static byte[] |
generateSignature(byte[] dataToSign,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
Method that generates a signature.
|
static byte[] |
generateSignaturePAdESRubric(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)
Method that generates a signature with rubric.
|
static OriginalSignedData |
getSignedData(byte[] signature)
Method that obtains the data originally signed from a signature.
|
static byte[] |
upgradeSignature(byte[] signature,
java.util.List<java.security.cert.X509Certificate> listSigners)
Method that upgrades a signature adding a timestamp to all of the signers indicated.
|
static java.lang.Object |
verifySignature(byte[] signature,
byte[] signedData)
Method that validates the signers of a signature.
|
public static byte[] generateSignature(byte[] dataToSign,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
throws SigningException
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).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_LEVELSigningException - If the method fails.public static byte[] generateCoSignature(byte[] signature,
byte[] signedData,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
throws SigningException
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).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_LEVELSigningException - If the method fails.public static byte[] generateCounterSignature(byte[] signature,
java.security.KeyStore.PrivateKeyEntry privateKey,
boolean includeSignaturePolicy,
boolean includeTimestamp)
throws SigningException
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).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_LEVELSigningException - If the method fails.public static byte[] generateSignaturePAdESRubric(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)
throws SigningException
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.SigningException - If the method fails.public static byte[] generateMultiSignaturePAdESRubric(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)
throws SigningException
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.SigningException - If the method fails.public static byte[] upgradeSignature(byte[] signature,
java.util.List<java.security.cert.X509Certificate> listSigners)
throws SigningException
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.SigningException - If the method fails.public static java.lang.Object verifySignature(byte[] signature,
byte[] signedData)
signature - Parameter that represents the signature to validate.signedData - Parameter that represents the original data signed by the signature.ValidationResult for ASN.1, XML and ASiC-S signatures.PDFValidationResult for PDF signatures.public static OriginalSignedData getSignedData(byte[] signature) throws SigningException
signature - Parameter that represents the signature of which is to obtain the data.SigningException - If the method fails.