Package es.gob.afirma.utils
Class UtilsResourcesSignOperations
- java.lang.Object
-
- es.gob.afirma.utils.UtilsResourcesSignOperations
-
public class UtilsResourcesSignOperations extends java.lang.ObjectClass that provides functionality to control the resources for sign-operations module.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.3, 18/04/2022.
- Author:
- Gobierno de España.
-
-
Constructor Summary
Constructors Constructor Description UtilsResourcesSignOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectgetCanonicalizer(java.lang.String canonicalizationMethod)Method that obtains the canonicalizer associated to the URI of the canonicalization method to use.static java.lang.StringgetMimeType(byte[] data)Method that detects the media type of the given document.
-
-
-
Method Detail
-
getMimeType
public static java.lang.String getMimeType(byte[] data)
Method that detects the media type of the given document. The type detection is based on the content of the given document stream.- Parameters:
data- Parameter that represents the data to check.- Returns:
- the detected media type.
-
getCanonicalizer
public static java.lang.Object getCanonicalizer(java.lang.String canonicalizationMethod) throws org.apache.xml.security.c14n.InvalidCanonicalizerExceptionMethod that obtains the canonicalizer associated to the URI of the canonicalization method to use.- Parameters:
canonicalizationMethod- Parameter that represents the URI of the canonicalization algorithm to use.- Returns:
- an object that represents the canonializer. The canonicalizer will be:
Canonicalizer11_OmitCommentsif the canonicalization algorithm to use isALGO_ID_C14N11_OMIT_COMMENTS.Canonicalizer11_WithCommentsif the canonicalization algorithm to use isALGO_ID_C14N11_WITH_COMMENTS.Canonicalizeron another case.
- Throws:
org.apache.xml.security.c14n.InvalidCanonicalizerException- If the canonicalization algorithm is unsupported.
-
-