public interface Signer
Interface that defines the common methods to implement for generate and upgrade signatures.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
coSign(byte[] signature,
byte[] document,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
Method that generates a basic co-signature (signature with signers on parallel).
|
byte[] |
coSign(byte[] signature,
byte[] document,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
Method that generates a basic co-signature (signature with signers on parallel).
|
byte[] |
counterSign(byte[] signature,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
Method that generates a basic counter-signature (signature with signers on serial).
|
byte[] |
counterSign(byte[] signature,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
Method that generates a basic counter-signature (signature with signers on serial).
|
OriginalSignedData |
getSignedData(byte[] signature)
Method that obtains the data originally signed from a signature.
|
byte[] |
sign(byte[] data,
java.lang.String algorithm,
java.lang.String signatureFormat,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
Method that generates a basic signature.
|
byte[] |
sign(byte[] data,
java.lang.String algorithm,
java.lang.String signatureFormat,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
Method that generates a basic signature.
|
byte[] |
upgrade(byte[] signature,
java.util.List<java.security.cert.X509Certificate> listSigners)
Method that upgrades a signature adding a timestamp to all of the signers indicated.
|
byte[] |
upgrade(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.
|
byte[] sign(byte[] data,
java.lang.String algorithm,
java.lang.String signatureFormat,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
throws SigningException
data - Parameter that represents the data to sign.algorithm - Parameter that represents the signature algorithm.signatureFormat - Parameter that represents the signing mode.
The allowed values for a CAdES (Baseline or not) signature are:
The allowed values for a XAdES (Baseline or not) signature are:
The allowed values for PAdES (Baseline or not) signature are:
privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
The allowed values for PAdES signature are:
The allowed values for PAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.SigningException - If the method fails.byte[] coSign(byte[] signature,
byte[] document,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
throws SigningException
signature - Parameter that represents the original signature.document - Parameter that represents the data used to generate the original signature.algorithm - Parameter that represents the signature algorithm.privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.SigningException - If the method fails.byte[] counterSign(byte[] signature,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID)
throws SigningException
signature - Parameter that represents the original signature.algorithm - Parameter that represents the signature algorithm.privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.SigningException - If the method fails.byte[] sign(byte[] data,
java.lang.String algorithm,
java.lang.String signatureFormat,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
throws SigningException
data - Parameter that represents the data to sign.algorithm - Parameter that represents the signature algorithm.signatureFormat - Parameter that represents the signing mode.
The allowed values for a CAdES (Baseline or not) signature are:
The allowed values for a XAdES (Baseline or not) signature are:
The allowed values for PAdES (Baseline or not) signature are:
privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
The allowed values for PAdES signature are:
The allowed values for PAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.idClient - Parameter that represents the client application identifier.SigningException - If the method fails.byte[] coSign(byte[] signature,
byte[] document,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
throws SigningException
signature - Parameter that represents the original signature.document - Parameter that represents the data used to generate the original signature.algorithm - Parameter that represents the signature algorithm.privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.idClient - Parameter that represents the client application identifier.SigningException - If the method fails.byte[] counterSign(byte[] signature,
java.lang.String algorithm,
java.security.KeyStore.PrivateKeyEntry privateKey,
java.util.Properties extraParams,
boolean includeTimestamp,
java.lang.String signatureForm,
java.lang.String signaturePolicyID,
java.lang.String idClient)
throws SigningException
signature - Parameter that represents the original signature.algorithm - Parameter that represents the signature algorithm.privateKey - Parameter that represents the private key of the signing certificate.extraParams - Set of extra configuration parameters. The allowed parameters are:
SignatureProperties.CADES_POLICY_QUALIFIER_PROP. This property is only allowed for CAdES (Baseline or not) signatures.SignatureProperties.XADES_CLAIMED_ROLE_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_POLICY_QUALIFIER_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_DESCRIPTION_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_MIME_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.XADES_DATA_FORMAT_ENCODING_PROP. This property is only allowed for XAdES (Baseline or not) signatures.SignatureProperties.PADES_CERTIFICATION_LEVEL. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_CONTACT_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOCATION_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_REASON_PROP. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_LOWER_LEFT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_X. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_UPPER_RIGHT_Y. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE. This property is only allowed for PAdES (Baseline or not) signatures.SignatureProperties.PADES_IMAGE_PAGE. This property is only allowed for PAdES (Baseline or not) signatures.includeTimestamp - Parameter that indicates if the signature will include a timestamp (true) or not (false).signatureForm - Parameter that represents the signature form.
The allowed values for CAdES signature are:
The allowed values for CAdES Baseline signature are:
The allowed values for XAdES signature are:
The allowed values for XAdES Baseline signature are:
signaturePolicyID - Parameter that represents the identifier of the signature policy used for generate the signature with signature
policies. The identifier must be defined on the properties file where to configure the validation and generation of signatures with
signature policies.idClient - Parameter that represents the client application identifier.SigningException - If the method fails.byte[] upgrade(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.byte[] upgrade(byte[] signature,
java.util.List<java.security.cert.X509Certificate> listSigners,
java.lang.String idClient)
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.idClient - Parameter that represents the client application identifier.SigningException - If the method fails.OriginalSignedData getSignedData(byte[] signature) throws SigningException
signature - Parameter that represents the signature of which is to obtain the data.SigningException - If the metod fails.