Tabnine Logo
DSSDocumentContext
Code IndexAdd Tabnine to your IDE (free)

How to use
DSSDocumentContext
in
be.fedict.eid.dss.spi

Best Java code snippets using be.fedict.eid.dss.spi.DSSDocumentContext (Showing top 8 results out of 315)

origin: be.fedict.eid-dss/eid-dss-document-xml

  public LSInput resolveResource(String type, String namespaceURI,
      String publicId, String systemId, String baseURI) {
    LOG.debug("resolve resource");
    LOG.debug("type: " + type);
    LOG.debug("namespace URI: " + namespaceURI);
    LOG.debug("public Id: " + publicId);
    LOG.debug("system Id: " + systemId);
    LOG.debug("base URI: " + baseURI);
    if (false == "http://www.w3.org/2001/XMLSchema".equals(type)) {
      throw new RuntimeException("unsupported type: " + type);
    }
    byte[] xsd = this.context.getXmlSchema(namespaceURI);
    if (null != xsd) {
      SignatureServiceLSInput lsInput = new SignatureServiceLSInput(xsd,
          publicId, systemId, baseURI);
      return lsInput;
    }
    throw new RuntimeException("unsupported namespace: " + namespaceURI);
    /*
     * Cannot return null here, else the system starts downloading the file.
     */
  }
}
origin: be.fedict.eid-dss/eid-dss-document-xml

public DocumentVisualization visualizeDocument(byte[] document,
    String language, List<MimeType> mimeTypes,
    String documentViewerServlet) throws Exception {
  // per default we do nothing
  byte[] browserData = document;
  String browserContentType = "text/xml";
  ByteArrayInputStream documentInputStream = new ByteArrayInputStream(
      document);
  Document dom = this.documentBuilder.parse(documentInputStream);
  String namespace = dom.getDocumentElement().getNamespaceURI();
  if (null != namespace) {
    LOG.debug("document namespace: " + namespace);
    byte[] xsl = this.context.getXmlStyleSheet(namespace);
    if (null != xsl) {
      LOG.debug("XML style sheet present");
      browserContentType = "text/html";
      Transformer transformer = this.transformerFactory
          .newTransformer(new StreamSource(
              new ByteArrayInputStream(xsl)));
      if (null != language) {
        transformer.setParameter("language", language);
      }
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      transformer.transform(new DOMSource(dom), new StreamResult(
          outputStream));
      browserData = outputStream.toByteArray();
    }
  }
  return new DocumentVisualization(browserContentType, browserData);
}
origin: be.fedict.eid-dss/eid-dss-document-ooxml

public OOXMLSignatureService(InputStream documentInputStream,
    OutputStream documentOutputStream, SignatureFacet signatureFacet,
    String role, IdentityDTO identity, byte[] photo,
    RevocationDataService revocationDataService,
    TimeStampService timeStampService, DigestAlgo signatureDigestAlgo,
    DSSDocumentContext documentContext) throws IOException {
  super(signatureDigestAlgo);
  this.temporaryDataStorage = new HttpSessionTemporaryDataStorage();
  this.documentOutputStream = documentOutputStream;
  this.tmpFile = File.createTempFile("eid-dss-", ".ooxml");
  documentContext.deleteWhenSessionDestroyed(this.tmpFile);
  FileOutputStream fileOutputStream;
  fileOutputStream = new FileOutputStream(this.tmpFile);
  IOUtils.copy(documentInputStream, fileOutputStream);
  addSignatureFacet(signatureFacet);
  addSignatureFacet(new XAdESXLSignatureFacet(timeStampService,
      revocationDataService, getSignatureDigestAlgorithm()));
  XAdESSignatureFacet xadesSignatureFacet = super
      .getXAdESSignatureFacet();
  xadesSignatureFacet.setRole(role);
  if (null != identity) {
    IdentitySignatureFacet identitySignatureFacet = new IdentitySignatureFacet(
        identity, photo, getSignatureDigestAlgorithm());
    addSignatureFacet(identitySignatureFacet);
  }
}
origin: be.fedict.eid-dss/eid-dss-spi-utils

      .getOCSPResponses(revocationValues);
  for (TimeStampToken signatureTimeStampToken : signatureTimeStampTokens) {
    this.documentContext.validate(signatureTimeStampToken,
        ocspResponses, crls);
    this.documentContext.validate(signatureTimeStampToken);
      .getOCSPResponses(revocationValues);
  for (TimeStampToken sigAndRefsTimeStampToken : sigAndRefsTimeStampTokens) {
    this.documentContext.validate(sigAndRefsTimeStampToken,
        ocspResponses, crls);
    this.documentContext.validate(sigAndRefsTimeStampToken);
    .getTimestampMaxOffset();
LOG.debug("validate timestamp tokens time coherence...");
for (TimeStampToken signatureTimeStampToken : signatureTimeStampTokens) {
long maxGracePeriod = this.documentContext.getMaxGracePeriod();
for (TimeStampToken sigAndRefsTimeStampToken : sigAndRefsTimeStampTokens) {
  DateTime sigAndRefsTokenGenTime = new DateTime(
this.documentContext.validate(certificateChain,
    signingTime.toDate(), ocspResponses, crls);
origin: be.fedict.eid-dss/eid-dss-document-odf

this.documentOutputStream = documentOutputStream;
this.tmpFile = File.createTempFile("eid-dss-", ".odf");
documentContext.deleteWhenSessionDestroyed(this.tmpFile);
FileOutputStream fileOutputStream;
fileOutputStream = new FileOutputStream(this.tmpFile);
origin: be.fedict.eid-dss/eid-dss-document-zip

documentContext.deleteWhenSessionDestroyed(this.tmpFile);
FileOutputStream fileOutputStream;
fileOutputStream = new FileOutputStream(this.tmpFile);
origin: be.fedict.eid-dss/eid-dss-document-xml

public void checkIncomingDocument(byte[] document) throws Exception {
  LOG.debug("checking incoming document");
  ByteArrayInputStream documentInputStream = new ByteArrayInputStream(
      document);
  Document dom = this.documentBuilder.parse(documentInputStream);
  String namespace = dom.getDocumentElement().getNamespaceURI();
  if (null == namespace) {
    LOG.debug("no namespace defined");
    return;
  }
  byte[] xsd = this.context.getXmlSchema(namespace);
  if (null == xsd) {
    LOG.debug("no XML schema available for namespace: " + namespace);
    return;
  }
  LOG.debug("validating against XML schema: " + namespace);
  SchemaFactory schemaFactory = SchemaFactory
      .newInstance("http://www.w3.org/2001/XMLSchema");
  schemaFactory
      .setResourceResolver(new SignatureServiceLSResourceResolver(
          this.context));
  StreamSource schemaSource = new StreamSource(new ByteArrayInputStream(
      xsd));
  Schema schema = schemaFactory.newSchema(schemaSource);
  Validator validator = schema.newValidator();
  DOMSource domSource = new DOMSource(dom);
  validator.validate(domSource);
}
origin: be.fedict.eid-dss/eid-dss-document-xml

    .getXmlStyleSheet(namespace);
if (null == stylesheetData) {
  return;
be.fedict.eid.dss.spiDSSDocumentContext

Javadoc

Document context interface. Should only allow access to resources that are not dependent on some proxy configuration.

Most used methods

  • deleteWhenSessionDestroyed
    Via this method the DSSDocumentService can register files which should be deleted when the correspon
  • getMaxGracePeriod
  • getTimestampMaxOffset
    Used when validating timestamp tokens.
  • getXmlSchema
  • getXmlStyleSheet
  • validate
    Validate the given timestamp token. We perform a historical validation here using the given revocati

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now