public class TmchValidatingParser extends TmchXmlParser
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CERTIFICATE_BEGIN_DELIMITER |
static java.lang.String |
CERTIFICATE_END_DELIMITER |
BUFFER_SIZE, ENCODED_PART_BEGIN_SIGN, ENCODED_PART_END_SIGN
Constructor and Description |
---|
TmchValidatingParser(java.io.InputStream certificateRevocationList,
java.io.InputStream smdRevocationList,
java.io.InputStream tmchIssuingAuthorityCert)
Instantiate a TmchValidatingParser which validates and parses an encoded SMD.
|
Modifier and Type | Method and Description |
---|---|
SignedMarkData |
validateAndParseEncodedSignedMarkData(java.io.InputStream encodedSignedMarkData)
Decodes and validates the provided base64-encoded SMD against the current date.
|
SignedMarkData |
validateAndParseEncodedSignedMarkData(java.io.InputStream encodedSignedMarkData,
java.util.Date dateForValidation)
Decodes and validates the provided base64-encoded SMD based on the provided date.
|
decodeSignedMarkData, extractBase64EncodedPartFromSmdFile, loadSmdXmlIntoDocument, parseDecodedSignedMarkData, parseEncodedSignedMarkData
public static final java.lang.String CERTIFICATE_BEGIN_DELIMITER
public static final java.lang.String CERTIFICATE_END_DELIMITER
public TmchValidatingParser(java.io.InputStream certificateRevocationList, java.io.InputStream smdRevocationList, java.io.InputStream tmchIssuingAuthorityCert) throws java.security.cert.CertificateException, java.security.cert.CRLException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException
certificateRevocationList
- the Certificate Revocation ListsmdRevocationList
- the SMD Revocation ListtmchIssuingAuthorityCert
- the SMD Issuing Authority Certificatejava.security.cert.CertificateException
- if an exception occurs while processing CRL or Issuing Authority certificatejava.security.cert.CRLException
- if an exception occurs while processing CRLjava.io.IOException
- if an exception occurs while processing SMDRL or Issuing Authority certificatejava.security.KeyStoreException
- if an exception occurs while processing Issuing Authority certificatejava.security.NoSuchAlgorithmException
- if an exception occurs while processing Issuing Authority certificatepublic SignedMarkData validateAndParseEncodedSignedMarkData(java.io.InputStream encodedSignedMarkData, java.util.Date dateForValidation) throws ParsingException, java.io.IOException, org.apache.commons.codec.DecoderException, javax.xml.parsers.ParserConfigurationException, javax.xml.xpath.XPathExpressionException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.KeyStoreException, java.security.InvalidAlgorithmParameterException, org.xml.sax.SAXException
encodedSignedMarkData
- Input stream to the base64-encoded SMD to be validated.dateForValidation
- The date against which the input SMD needs to be validated against.java.io.IOException
- In case the input stream cannot be readParsingException
- In case an error occurs while parsingorg.apache.commons.codec.DecoderException
- In case the stream cannot be decodedjavax.xml.xpath.XPathExpressionException
- if an exception occurs while parsing the decoded SMDjavax.xml.parsers.ParserConfigurationException
- if an exception occurs while parsing the decoded SMDjava.security.NoSuchAlgorithmException
- if an exception occurs while parsing the SMD certificatejava.security.cert.CertificateException
- if an exception occurs while validating SMD certificatejava.security.KeyStoreException
- if an exception occurs while validating SMD certificatejava.security.InvalidAlgorithmParameterException
- if an exception occurs while validating SMD certificateorg.xml.sax.SAXException
public SignedMarkData validateAndParseEncodedSignedMarkData(java.io.InputStream encodedSignedMarkData) throws ParsingException, java.io.IOException, org.apache.commons.codec.DecoderException, javax.xml.parsers.ParserConfigurationException, javax.xml.xpath.XPathExpressionException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.KeyStoreException, java.security.InvalidAlgorithmParameterException, org.xml.sax.SAXException
encodedSignedMarkData
- Input stream to the base64-encoded SMD to be validatedjava.io.IOException
- In case the input stream cannot be readParsingException
- In case an error occurs while parsingorg.apache.commons.codec.DecoderException
- In case the stream cannot be decodedjavax.xml.xpath.XPathExpressionException
- if an exception occurs while parsing the decoded SMDjavax.xml.parsers.ParserConfigurationException
- if an exception occurs while parsing the decoded SMDjava.security.NoSuchAlgorithmException
- if an exception occurs while parsing the SMD certificatejava.security.cert.CertificateException
- if an exception occurs while validating SMD certificatejava.security.KeyStoreException
- if an exception occurs while validating SMD certificatejava.security.InvalidAlgorithmParameterException
- if an exception occurs while validating SMD certificateorg.xml.sax.SAXException