Package es.gob.afirma.signature.xades
Class XadesExt
- java.lang.Object
-
- net.java.xades.security.xml.XAdES.XMLAdvancedSignature
-
- es.gob.afirma.signature.xades.XadesExt
-
public final class XadesExt extends XMLAdvancedSignature
Class that extends
XMLAdvancedSignaturewith new changes:SubjectX500PrincipalandX509IssuerSerialelements are included in theKeyInfoelement.- Signature algorithm can be set.
- Canonicalization algorithm of the signature can be set.
- Namespace of XAdES can be set.
Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.3, 13/04/2020.
-
-
Field Summary
-
Fields inherited from class net.java.xades.security.xml.XAdES.XMLAdvancedSignature
ELEMENT_SIGNATURE, ELEMENT_SIGNATURE_VALUE, SIGNED_PROPERTIES_REFERENCE_TYPE, XADES_v132, XADES_v141
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisXAdESBaseline()Gets the value of the attributeisXAdESBaseline.static XadesExtnewInstance(XAdES_BES xades, boolean isXAdESBaselineParam)Creates a new instance of typeXadesExt.voidsetCanonicalizationMethod(java.lang.String canMethod)Establece el algoritmo de canonicalización.voidsetXAdESBaseline(boolean isXAdESBaselineParam)Sets the value of the attributeisXAdESBaseline.voidsign(java.security.cert.X509Certificate certificate, java.security.PrivateKey privateKey, java.lang.String signatureMethod, java.util.List refsIdList, java.lang.String signatureIdPrefix, java.lang.String tsaURL)-
Methods inherited from class net.java.xades.security.xml.XAdES.XMLAdvancedSignature
addXMLObject, enrichUnsignedProperties, getBaseElement, getInstance, getQualifyingPropertiesReferences, getWrappedKeyStorePlace, getXMLObjects, getXmlWrappedKeyInfo, newInstance, setDigestMethod, setQualifyingPropertiesReferences, setWrappedKeyStorePlace, setXadesNamespace, setXmlWrappedKeyInfo, validate
-
-
-
-
Method Detail
-
setCanonicalizationMethod
public void setCanonicalizationMethod(java.lang.String canMethod)
Establece el algoritmo de canonicalización.- Parameters:
canMethod- URL del algoritmo de canonicalización. Debe estar soportado en XMLDSig 1.0 ó 1.1
-
isXAdESBaseline
public boolean isXAdESBaseline()
Gets the value of the attributeisXAdESBaseline.- Returns:
- the value of the attribute
isXAdESBaseline.
-
setXAdESBaseline
public void setXAdESBaseline(boolean isXAdESBaselineParam)
Sets the value of the attributeisXAdESBaseline.- Parameters:
isXAdESBaselineParam- The value for the attributeisXAdESBaseline.
-
sign
public void sign(java.security.cert.X509Certificate certificate, java.security.PrivateKey privateKey, java.lang.String signatureMethod, java.util.List refsIdList, java.lang.String signatureIdPrefix, java.lang.String tsaURL) throws javax.xml.crypto.MarshalException, javax.xml.crypto.dsig.XMLSignatureException, java.security.GeneralSecurityException- Overrides:
signin classXMLAdvancedSignature- Throws:
javax.xml.crypto.MarshalExceptionjavax.xml.crypto.dsig.XMLSignatureExceptionjava.security.GeneralSecurityException- See Also:
XMLAdvancedSignature.sign(java.security.cert.X509Certificate, java.security.PrivateKey, java.lang.String, java.util.List, java.lang.String, java.lang.String)
-
newInstance
public static XadesExt newInstance(XAdES_BES xades, boolean isXAdESBaselineParam) throws java.security.GeneralSecurityException
Creates a new instance of typeXadesExt.- Parameters:
xades- data container.isXAdESBaselineParam- parameter that indicates XAdES Baseline.- Returns:
- a new object of type es.gob.afirma.signature.xades.XadesExt
- Throws:
java.security.GeneralSecurityException- in error case.
-
-