public final class SignaturePolicyManager
extends java.lang.Object
Class that manages all the operations related to signature policies.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Method and Description |
|---|---|
static void |
addASN1SignPolicy(org.bouncycastle.asn1.ASN1EncodableVector contexExpecific,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties,
boolean isPAdES)
Method that adds the
SignaturePolicyIdentifier element to an ASN.1 object. |
static void |
addASN1SignPolicy(org.bouncycastle.asn1.ASN1EncodableVector contexExpecific,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties,
boolean isPAdES,
java.lang.String idClient)
Method that adds the
SignaturePolicyIdentifier element to an ASN.1 object. |
static void |
addXMLSignPolicy(XAdES_EPES xades,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties)
Method that adds the
xades:SignaturePolicyIdentifier element to a XAdES object. |
static void |
addXMLSignPolicy(XAdES_EPES xades,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that adds the
xades:SignaturePolicyIdentifier element to a XAdES object. |
static boolean |
isValidASN1HashAlgorithmByPolicy(org.bouncycastle.asn1.x509.AlgorithmIdentifier digestAlgorithmId,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the OID of a hash algorithm is valid for certain signature policy.
|
static boolean |
isValidASN1SignAlgorithmByPolicy(org.bouncycastle.asn1.x509.AlgorithmIdentifier signAlgorithmId,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the OID of a signature algorithm is valid for certain signature policy.
|
static boolean |
isValidASN1SigningModeByPolicy(boolean includeContent,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the signing mode of the CAdES-EPES signature is allowed by the signature policy defined on the properties file where
to configure the validation and generation of signatures with signature policies.
|
static boolean |
isValidXMLHashAlgorithmByPolicy(java.lang.String uriAlgorithm,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the URI of a hash algorithm is valid for certain signature policy.
|
static boolean |
isValidXMLSignAlgorithmByPolicy(java.lang.String uriAlgorithm,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the URI of a signature algorithm is valid for certain signature policy.
|
static boolean |
isValidXMLSigningModeByPolicy(java.lang.String signingMode,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that checks if the signing mode of the XAdES-EPES signature is allowed by the signature policy defined on the properties file where
to configure the validation and generation of signatures with signature policies.
|
static void |
validateCAdESEPESSignature(org.bouncycastle.cms.SignerInformation signerInformation,
java.util.Properties properties,
boolean isCounterSigner,
boolean includeContent,
java.lang.String idClient)
Method that validates a CAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
static void |
validateGeneratedCAdESEPESSignature(org.bouncycastle.asn1.cms.SignerInfo signerInfo,
java.lang.String policyID,
java.util.Properties properties,
boolean isCounterSigner,
java.lang.String idClient)
Method that validates a generated CAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
static void |
validateGeneratedPAdESEPESSignature(com.lowagie.text.pdf.PdfDictionary pdfSignatureDictionary,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that validates a generated PAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
static void |
validateGeneratedXAdESEPESSignature(org.w3c.dom.Element dsSignature,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
Method that validates a generated XAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
static void |
validatePAdESEPESSignature(org.bouncycastle.cms.SignerInformation signerInformation,
com.lowagie.text.pdf.PdfDictionary pdfSignatureDictionary,
java.util.Properties properties,
java.lang.String idClient)
Method that validates a PAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
static void |
validateXAdESEPESSignature(org.w3c.dom.Element dsSignature,
java.util.Properties properties,
java.lang.String signingMode,
java.lang.String idClient)
Method that validates a XAdES-EPES signature by the signature policy defined on the properties file where to configure the validation and
generation of signatures with signature policies.
|
public static void addASN1SignPolicy(org.bouncycastle.asn1.ASN1EncodableVector contexExpecific,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties,
boolean isPAdES,
java.lang.String idClient)
throws SignaturePolicyException
SignaturePolicyIdentifier element to an ASN.1 object.contexExpecific - Parameter that represents the set of values of the signer info.qualifier - Parameter that represents the signature policy qualifier.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.isPAdES - Parameter that indicates if the SignaturePolicyIdentifier will be added to a PAdES signature (true) or to a CAdESidClient - Parameter that represents the client application identifier.
signature (false).SignaturePolicyException - If the method fails.public static void addASN1SignPolicy(org.bouncycastle.asn1.ASN1EncodableVector contexExpecific,
java.lang.String qualifier,
java.lang.String policyID,
java.util.Properties properties,
boolean isPAdES)
throws SignaturePolicyException
SignaturePolicyIdentifier element to an ASN.1 object.contexExpecific - Parameter that represents the set of values of the signer info.qualifier - Parameter that represents the signature policy qualifier.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.isPAdES - Parameter that indicates if the SignaturePolicyIdentifier will be added to a PAdES signature (true) or to a CAdES
signature (false).SignaturePolicyException - If the method fails.public static void addXMLSignPolicy(XAdES_EPES xades, java.lang.String qualifier, java.lang.String policyID, java.util.Properties properties, java.lang.String idClient) throws SignaturePolicyException
xades:SignaturePolicyIdentifier element to a XAdES object.xades - Parameter that represents the XAdES object.qualifier - Parameter that represents the signature policy qualifier.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void addXMLSignPolicy(XAdES_EPES xades, java.lang.String qualifier, java.lang.String policyID, java.util.Properties properties) throws SignaturePolicyException
xades:SignaturePolicyIdentifier element to a XAdES object.xades - Parameter that represents the XAdES object.qualifier - Parameter that represents the signature policy qualifier.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.SignaturePolicyException - If the method fails.public static void validateGeneratedPAdESEPESSignature(com.lowagie.text.pdf.PdfDictionary pdfSignatureDictionary,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
throws SignaturePolicyException
pdfSignatureDictionary - Parameter that represents the PDF signature dictionary.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void validateGeneratedCAdESEPESSignature(org.bouncycastle.asn1.cms.SignerInfo signerInfo,
java.lang.String policyID,
java.util.Properties properties,
boolean isCounterSigner,
java.lang.String idClient)
throws SignaturePolicyException
signerInfo - Parameter that represents the information related to the signer.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.isCounterSigner - Parameter that indicates if the signer a counter-signer (true) or not (false).idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void validateGeneratedXAdESEPESSignature(org.w3c.dom.Element dsSignature,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
throws SignaturePolicyException
dsSignature - Parameter that represents the ds:Signature element of the XAdES-EPES signature.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void validatePAdESEPESSignature(org.bouncycastle.cms.SignerInformation signerInformation,
com.lowagie.text.pdf.PdfDictionary pdfSignatureDictionary,
java.util.Properties properties,
java.lang.String idClient)
throws SignaturePolicyException
signerInformation - Parameter that represents the information related to the signer.pdfSignatureDictionary - Parameter that represents the PDF signature dictionary.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void validateCAdESEPESSignature(org.bouncycastle.cms.SignerInformation signerInformation,
java.util.Properties properties,
boolean isCounterSigner,
boolean includeContent,
java.lang.String idClient)
throws SignaturePolicyException
signerInformation - Parameter that represents the information related to the signer.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.isCounterSigner - Parameter that indicates if the signer a counter-signer (true) or not (false).includeContent - Parameter that indicates if the signature includes the signed data (true) or not (false).idClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static void validateXAdESEPESSignature(org.w3c.dom.Element dsSignature,
java.util.Properties properties,
java.lang.String signingMode,
java.lang.String idClient)
throws SignaturePolicyException
dsSignature - Parameter that represents the ds:Signature element of the XAdES-EPES signature.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.signingMode - Parameter that represents the signing mode of the XAdES-EPES signature. The possible values are:
UtilsSignature#DETACHED_SIGNATURE_MODEUtilsSignature##ENVELOPED_SIGNATURE_MODEUtilsSignature##ENVELOPING_SIGNATURE_MODEidClient - Parameter that represents the client application identifier.SignaturePolicyException - If the method fails.public static boolean isValidASN1SigningModeByPolicy(boolean includeContent,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
includeContent - Parameter that indicates whether the document content is included in the signature (true) or is only referenced (false).policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation
and generation of signatures with signature policies.
* @param idClient Parameter that represents the client application identifier.public static boolean isValidXMLSigningModeByPolicy(java.lang.String signingMode,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
signingMode - Parameter that represents the signing mode of the XAdES-EPES signature. The possible values are:
UtilsSignature#DETACHED_SIGNATURE_MODEUtilsSignature##ENVELOPED_SIGNATURE_MODEUtilsSignature##ENVELOPING_SIGNATURE_MODEpolicyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation
and generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.public static boolean isValidXMLHashAlgorithmByPolicy(java.lang.String uriAlgorithm,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
uriAlgorithm - Parameter that represents the URI of the hash algorithm.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.public static boolean isValidASN1HashAlgorithmByPolicy(org.bouncycastle.asn1.x509.AlgorithmIdentifier digestAlgorithmId,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
digestAlgorithmId - Parameter that represents the OID of the hash algorithm.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.public static boolean isValidASN1SignAlgorithmByPolicy(org.bouncycastle.asn1.x509.AlgorithmIdentifier signAlgorithmId,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
signAlgorithmId - Parameter that represents the OID of the signature algorithm.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.public static boolean isValidXMLSignAlgorithmByPolicy(java.lang.String uriAlgorithm,
java.lang.String policyID,
java.util.Properties properties,
java.lang.String idClient)
uriAlgorithm - Parameter that represents the URI of the signature algorithm.policyID - Parameter that represents the identifier of the signature policy defined inside of the properties file where to configure the
validation and generation of signatures with signature policies.properties - Parameter that represents the set of properties defined inside of the properties file where to configure the validation and
generation of signatures with signature policies.idClient - Parameter that represents the client application identifier.