Package es.gob.afirma.signature
Class SignatureFormatDetectorASiC
- java.lang.Object
-
- es.gob.afirma.signature.SignatureFormatDetectorASiC
-
- All Implemented Interfaces:
ISignatureFormatDetector
public final class SignatureFormatDetectorASiC extends java.lang.Object implements ISignatureFormatDetector
Class that represents a format checker for Associated Signature Containers (ASiC).
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.0, 18/01/2016.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringASIC_S_MIME_TYPEConstant attribute that represents the mime type of the ZIP file to identify the ASiC-S format.static java.lang.StringMETA_INF_FOLDERConstant attribute that identifies the root for the signatures and manifests contained inside of an ASiC signature.static java.lang.StringMIME_TYPE_FILEConstant attribute that identifies the name of the file with the mime type contained inside of the ZIP file.static java.lang.StringNAME_SIGNATURE_CADES_BConstant attribute that represents the name of generated CAdES Baseline signature.static java.lang.StringNAME_SIGNATURE_XADES_BConstant attribute that represents the name of generated XAdES Baseline signature.-
Fields inherited from interface es.gob.afirma.signature.ISignatureFormatDetector
CADES_BASIC_FORMAT, FORMAT_ASIC_S_B_LEVEL, FORMAT_ASIC_S_LT_LEVEL, FORMAT_ASIC_S_LTA_LEVEL, FORMAT_ASIC_S_T_LEVEL, FORMAT_CADES_A, FORMAT_CADES_B_LEVEL, FORMAT_CADES_BES, FORMAT_CADES_C, FORMAT_CADES_EPES, FORMAT_CADES_LT_LEVEL, FORMAT_CADES_LTA_LEVEL, FORMAT_CADES_T, FORMAT_CADES_T_LEVEL, FORMAT_CADES_X1, FORMAT_CADES_X2, FORMAT_CADES_XL1, FORMAT_CADES_XL2, FORMAT_CMS, FORMAT_CMS_T, FORMAT_PADES_B_LEVEL, FORMAT_PADES_BASIC, FORMAT_PADES_BES, FORMAT_PADES_EPES, FORMAT_PADES_LT_LEVEL, FORMAT_PADES_LTA_LEVEL, FORMAT_PADES_LTV, FORMAT_PADES_T_LEVEL, FORMAT_PDF, FORMAT_UNRECOGNIZED, FORMAT_XADES_A, FORMAT_XADES_B_LEVEL, FORMAT_XADES_BES, FORMAT_XADES_C, FORMAT_XADES_EPES, FORMAT_XADES_LT_LEVEL, FORMAT_XADES_LTA_LEVEL, FORMAT_XADES_T, FORMAT_XADES_T_LEVEL, FORMAT_XADES_X1, FORMAT_XADES_X2, FORMAT_XADES_XL1, FORMAT_XADES_XL2, PKCS7_BASIC_FORMAT
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetSignatureFormat(byte[] signature)Method that obtains the format of an ASiC signature.static booleanisCAdESEntry(java.lang.String entryName)Method that indicates if the name of an entry of a ZIP file has the format:/META-INF/signature.p7s.static booleanisXAdESEntry(java.lang.String entryName)Method that indicates if the name of an entry of a ZIP file has the format:/META-INF/signature.xml.
-
-
-
Field Detail
-
META_INF_FOLDER
public static final java.lang.String META_INF_FOLDER
Constant attribute that identifies the root for the signatures and manifests contained inside of an ASiC signature.- See Also:
- Constant Field Values
-
MIME_TYPE_FILE
public static final java.lang.String MIME_TYPE_FILE
Constant attribute that identifies the name of the file with the mime type contained inside of the ZIP file.- See Also:
- Constant Field Values
-
ASIC_S_MIME_TYPE
public static final java.lang.String ASIC_S_MIME_TYPE
Constant attribute that represents the mime type of the ZIP file to identify the ASiC-S format.- See Also:
- Constant Field Values
-
NAME_SIGNATURE_CADES_B
public static final java.lang.String NAME_SIGNATURE_CADES_B
Constant attribute that represents the name of generated CAdES Baseline signature.- See Also:
- Constant Field Values
-
NAME_SIGNATURE_XADES_B
public static final java.lang.String NAME_SIGNATURE_XADES_B
Constant attribute that represents the name of generated XAdES Baseline signature.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSignatureFormat
public static java.lang.String getSignatureFormat(byte[] signature)
Method that obtains the format of an ASiC signature.- Parameters:
signature- Parameter that represents the ASiC signature as a ZIP file.- Returns:
- the signature format associated to the ZIP file. The value to return will be on of these:
-
isXAdESEntry
public static boolean isXAdESEntry(java.lang.String entryName)
Method that indicates if the name of an entry of a ZIP file has the format:/META-INF/signature.xml.- Parameters:
entryName- Parameter that represents the name of the entry.- Returns:
- a boolean that indicates if the name of an entry of a ZIP file has the format:
/META-INF/signature.xml(true) or not (false).
-
isCAdESEntry
public static boolean isCAdESEntry(java.lang.String entryName)
Method that indicates if the name of an entry of a ZIP file has the format:/META-INF/signature.p7s.- Parameters:
entryName- Parameter that represents the name of the entry.- Returns:
- a boolean that indicates if the name of an entry of a ZIP file has the format:
/META-INF/signature.p7s(true) or not (false).
-
-