Package es.gob.afirma.tsl.parsing.ifaces
Interface ITSLObject
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
TSLObject
public interface ITSLObject extends java.io.SerializableInterface that represents a TSL object regardless it implementation.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.0, 10/11/2020.
-
-
Method Summary
All Methods Instance Methods Abstract 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 is)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.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 tslID)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 signature)Sets the XML Signature for the TSL.voidsetTSLTag(java.net.URI tslTag)Sets the URI that represents the tag attribute for the TrustServiceStatus element.
-
-
-
Method Detail
-
getTSLTag
java.net.URI getTSLTag()
Gets the URI that represents the tag attribute for the TrustServiceStatus element.- Returns:
- URI that represents the tag attribute for the TrustServiceStatus element.
-
setTSLTag
void setTSLTag(java.net.URI tslTag) throws TSLArgumentExceptionSets the URI that represents the tag attribute for the TrustServiceStatus element.- Parameters:
tslTag- URI to set.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.
-
getID
java.lang.String getID()
Gets the ID attribute from the TrustServiceStatus element.- Returns:
- String with the ID of the TrustServiceStatus element.
nullif not is defined.
-
setID
void setID(java.lang.String tslID)
Sets the ID attribute for the TSL.- Parameters:
tslID- String that represents the ID to set. It can benull.
-
getSchemeInformation
SchemeInformation getSchemeInformation()
Gets the scheme information of the TSL.- Returns:
- representation object not dependent of the TSL implementation and version that represents the scheme information of this TSL.
-
setSchemeInformation
void setSchemeInformation(SchemeInformation si) throws TSLArgumentException
Sets the scheme information associated to this TSL.- Parameters:
si- Scheme information to be associated to this TSL.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.
-
getTrustServiceProviderList
java.util.List<TrustServiceProvider> getTrustServiceProviderList()
Gets the list with all the Trust Services Providers associated to this TSL.- Returns:
- list with all the Trust Services Providers associated to this TSL, if there is not,
then
null.
-
addNewTrustServiceProvider
void addNewTrustServiceProvider(TrustServiceProvider tsp) throws TSLArgumentException
Adds a new trust service provider to the list associated to this TSL.- Parameters:
tsp- Trust Service Provider to add. It can not benull.- Throws:
TSLArgumentException- In case of the input parameter isnullor not well formed.
-
isThereSomeTrustServiceProvider
boolean isThereSomeTrustServiceProvider()
Checks if exists at least one Trust Service Provider associated to this TSL.- Returns:
trueif exists at least one, otherwisefalse.
-
getSignature
org.w3.x2000.x09.xmldsig.SignatureType getSignature()
Gets the TSL signature.- Returns:
- TSL signature.
-
setSignature
void setSignature(org.w3.x2000.x09.xmldsig.SignatureType signature)
Sets the XML Signature for the TSL.- Parameters:
signature- XML Signature to set for this TSL.
-
checkTSLValues
void checkTSLValues() throws TSLMalformedExceptionChecks all the actual values assigned to this TSL as the concrecte specification and version requires.- Throws:
TSLMalformedException- In case of some data does not exist or has not a correct value.
-
buildTSLFromXMLcheckValues
void buildTSLFromXMLcheckValues(java.io.InputStream is) 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.- Parameters:
is- 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.
-
buildTSLFromXMLcheckValues
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.- 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.
-
checkValuesBuildXMLfromTSL
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.- 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.
-
-