Class TSLObject
- java.lang.Object
-
- es.gob.afirma.tsl.parsing.impl.common.TSLObject
-
- All Implemented Interfaces:
ITSLObject,java.io.Serializable
public class TSLObject extends java.lang.Object implements ITSLObject
Class that represents a TSL object with the principal functions (access information) regardless it implementation.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.1, 15/06/2021.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TSLObject()Constructor method for the class TSLObject.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNewTrustServiceProvider(TrustServiceProvider tsp)Adds a new trust service provider to the list associated to this TSL.voidbuildTSLFromXMLcheckValues(java.io.InputStream isParam)Method that builds the TSL data from a input XML.voidbuildTSLFromXMLcheckValues(java.io.InputStream is, boolean checkSignature)Method that builds the TSL data from a input XML.voidcheckTSLValues()Checks all the actual values assigned to this TSL as the concrecte specification and version requires.byte[]checkValuesBuildXMLfromTSL()Method that check that the data of the TSL is correct as the specification and version requires.java.lang.StringgetID()Gets the ID attribute from the TrustServiceStatus element.SchemeInformationgetSchemeInformation()Gets the scheme information of the TSL.org.w3.x2000.x09.xmldsig.SignatureTypegetSignature()Gets the TSL signature.java.util.List<TrustServiceProvider>getTrustServiceProviderList()Gets the list with all the Trust Services Providers associated to this TSL.java.lang.StringgetTslSpecification()Gets the value of the attributetslSpecification.java.lang.StringgetTslSpecificationVersion()Gets the value of the attributetslSpecificationVersion.java.net.URIgetTSLTag()Gets the URI that represents the tag attribute for the TrustServiceStatus element.booleanisThereSomeTrustServiceProvider()Checks if exists at least one Trust Service Provider associated to this TSL.voidsetID(java.lang.String id)Sets the ID attribute for the TSL.voidsetSchemeInformation(SchemeInformation si)Sets the scheme information associated to this TSL.voidsetSignature(org.w3.x2000.x09.xmldsig.SignatureType dsSignature)Sets the XML Signature for the TSL.voidsetTslSpecification(java.lang.String tslSpecification)Sets the value of the attributetslSpecification.voidsetTslSpecificationVersion(java.lang.String tslSpecificationVersion)Sets the value of the attributetslSpecificationVersion.voidsetTSLTag(java.net.URI tag)Sets the URI that represents the tag attribute for the TrustServiceStatus element.
-
-
-
Method Detail
-
getTSLTag
public final java.net.URI getTSLTag()
Gets the URI that represents the tag attribute for the TrustServiceStatus element.- Specified by:
getTSLTagin interfaceITSLObject- Returns:
- URI that represents the tag attribute for the TrustServiceStatus element.
- See Also:
ITSLObject.getTSLTag()
-
getTslSpecification
public java.lang.String getTslSpecification()
Gets the value of the attributetslSpecification.- Returns:
- the value of the attribute
tslSpecification.
-
setTslSpecification
public void setTslSpecification(java.lang.String tslSpecification)
Sets the value of the attributetslSpecification.- Parameters:
tslSpecification- The value for the attributetslSpecification.
-
getTslSpecificationVersion
public java.lang.String getTslSpecificationVersion()
Gets the value of the attributetslSpecificationVersion.- Returns:
- the value of the attribute
tslSpecificationVersion.
-
setTslSpecificationVersion
public void setTslSpecificationVersion(java.lang.String tslSpecificationVersion)
Sets the value of the attributetslSpecificationVersion.- Parameters:
tslSpecificationVersion- The value for the attributetslSpecificationVersion.
-
setTSLTag
public final void setTSLTag(java.net.URI tag) throws TSLArgumentExceptionSets the URI that represents the tag attribute for the TrustServiceStatus element.- Specified by:
setTSLTagin interfaceITSLObject- Parameters:
tag- URI to set.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.- See Also:
ITSLObject.setTSLTag(java.net.URI)
-
getID
public final java.lang.String getID()
Gets the ID attribute from the TrustServiceStatus element.- Specified by:
getIDin interfaceITSLObject- Returns:
- String with the ID of the TrustServiceStatus element.
nullif not is defined. - See Also:
ITSLObject.getID()
-
setID
public final void setID(java.lang.String id)
Sets the ID attribute for the TSL.- Specified by:
setIDin interfaceITSLObject- Parameters:
id- String that represents the ID to set. It can benull.- See Also:
ITSLObject.setID(java.lang.String)
-
getSchemeInformation
public final SchemeInformation getSchemeInformation()
Gets the scheme information of the TSL.- Specified by:
getSchemeInformationin interfaceITSLObject- Returns:
- representation object not dependent of the TSL implementation and version that represents the scheme information of this TSL.
- See Also:
ITSLObject.getSchemeInformation()
-
setSchemeInformation
public final void setSchemeInformation(SchemeInformation si) throws TSLArgumentException
Sets the scheme information associated to this TSL.- Specified by:
setSchemeInformationin interfaceITSLObject- Parameters:
si- Scheme information to be associated to this TSL.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.- See Also:
ITSLObject.setSchemeInformation(es.gob.afirma.tsl.parsing.impl.common.SchemeInformation)
-
getTrustServiceProviderList
public final java.util.List<TrustServiceProvider> getTrustServiceProviderList()
Gets the list with all the Trust Services Providers associated to this TSL.- Specified by:
getTrustServiceProviderListin interfaceITSLObject- Returns:
- list with all the Trust Services Providers associated to this TSL, if there is not,
then
null. - See Also:
ITSLObject.getTrustServiceProviderList()
-
addNewTrustServiceProvider
public final void addNewTrustServiceProvider(TrustServiceProvider tsp) throws TSLArgumentException
Adds a new trust service provider to the list associated to this TSL.- Specified by:
addNewTrustServiceProviderin interfaceITSLObject- Parameters:
tsp- Trust Service Provider to add. It can not benull.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.- See Also:
ITSLObject.addNewTrustServiceProvider(es.gob.afirma.tsl.parsing.impl.common.TrustServiceProvider)
-
isThereSomeTrustServiceProvider
public final boolean isThereSomeTrustServiceProvider()
Checks if exists at least one Trust Service Provider associated to this TSL.- Specified by:
isThereSomeTrustServiceProviderin interfaceITSLObject- Returns:
trueif exists at least one, otherwisefalse.- See Also:
ITSLObject.isThereSomeTrustServiceProvider()
-
getSignature
public final org.w3.x2000.x09.xmldsig.SignatureType getSignature()
Gets the TSL signature.- Specified by:
getSignaturein interfaceITSLObject- Returns:
- TSL signature.
- See Also:
ITSLObject.getSignature()
-
setSignature
public final void setSignature(org.w3.x2000.x09.xmldsig.SignatureType dsSignature)
Sets the XML Signature for the TSL.- Specified by:
setSignaturein interfaceITSLObject- Parameters:
dsSignature- XML Signature to set for this TSL.- See Also:
ITSLObject.setSignature(org.w3.x2000.x09.xmldsig.SignatureType)
-
checkTSLValues
public final void checkTSLValues() throws TSLMalformedExceptionChecks all the actual values assigned to this TSL as the concrecte specification and version requires.- Specified by:
checkTSLValuesin interfaceITSLObject- Throws:
TSLMalformedException- In case of some data does not exist or has not a correct value.- See Also:
ITSLObject.checkTSLValues()
-
buildTSLFromXMLcheckValues
public final void buildTSLFromXMLcheckValues(java.io.InputStream isParam) throws TSLArgumentException, TSLParsingException, TSLMalformedExceptionMethod that builds the TSL data from a input XML. This process overwrites the actual information of the object, but if there is some error parsing the XML, no data will be changed. When the data is parsed, then is checked if it has the correct values as the specification and version requires.- Specified by:
buildTSLFromXMLcheckValuesin interfaceITSLObject- Parameters:
isParam- InputStream Input Stream of the XML (TSL representation).- Throws:
TSLArgumentException- In case of the input parameter isnull.TSLParsingException- In case of some error parsing the XML input stream.TSLMalformedException- In case of some data does not exist or has not a correct value.- See Also:
ITSLObject.buildTSLFromXMLcheckValues(java.io.InputStream)
-
buildTSLFromXMLcheckValues
public final void buildTSLFromXMLcheckValues(java.io.InputStream is, boolean checkSignature) throws TSLArgumentException, TSLParsingException, TSLMalformedExceptionMethod that builds the TSL data from a input XML. This process overwrites the actual information of the object, but if there is some error parsing the XML, no data will be changed. When the data is parsed, then is checked if it has the correct values as the specification and version requires.- Specified by:
buildTSLFromXMLcheckValuesin interfaceITSLObject- Parameters:
is- InputStream Input Stream of the XML (TSL representation).checkSignature- Flag that indicates if the TSL signature must be checked (true).- Throws:
TSLArgumentException- In case of the input parameter isnull.TSLParsingException- In case of some error parsing the XML input stream.TSLMalformedException- In case of some data does not exist or has not a correct value.- See Also:
ITSLObject.buildTSLFromXMLcheckValues(java.io.InputStream, boolean)
-
checkValuesBuildXMLfromTSL
public final byte[] checkValuesBuildXMLfromTSL() throws TSLMalformedException, TSLEncodingExceptionMethod that check that the data of the TSL is correct as the specification and version requires. After this, builds the XML representation (concrete specification and version) of the TSL.- Specified by:
checkValuesBuildXMLfromTSLin interfaceITSLObject- Returns:
- byte array that represents the XML of the TSL.
- Throws:
TSLMalformedException- In case of some data does not exist or has not a correct value.TSLEncodingException- In case of some error encoding the TSL.- See Also:
ITSLObject.checkValuesBuildXMLfromTSL()
-
-