コード例 #1
0
  private void setSigningCertificateAndChain(
      final WSParameters wsParameters, final SignatureParameters params) {

    final byte[] signingCertBytes = wsParameters.getSigningCertificateBytes();
    if (signingCertBytes == null) {
      return;
    }
    final X509Certificate x509SigningCertificate = DSSUtils.loadCertificate(signingCertBytes);
    params.setSigningCertificate(x509SigningCertificate);

    final List<X509Certificate> chain = new ArrayList<X509Certificate>();
    chain.add(x509SigningCertificate);
    final List<byte[]> certificateChainByteArrayList =
        wsParameters.getCertificateChainByteArrayList();
    if (certificateChainByteArrayList != null) {

      for (final byte[] x509CertificateBytes : certificateChainByteArrayList) {

        final X509Certificate x509Certificate = DSSUtils.loadCertificate(x509CertificateBytes);
        if (!chain.contains(x509Certificate)) {

          chain.add(x509Certificate);
        }
      }
    }
    params.setCertificateChain(chain);
  }
コード例 #2
0
  private void setClaimedSignerRole(
      final WSParameters wsParameters, final SignatureParameters params) {
    final List<String> claimedSignerRoles = wsParameters.getClaimedSignerRole();
    if (claimedSignerRoles != null) {
      for (final String claimedSignerRole : claimedSignerRoles) {

        params.bLevel().addClaimedSignerRole(claimedSignerRole);
      }
    }
  }
コード例 #3
0
  private void setReferences(WSParameters wsParameters, SignatureParameters params) {

    final List<DSSReference> references = wsParameters.getReferences();
    //		System.out.println("###WS - REFERENCES:");
    //		if (references == null) {
    //
    //			System.out.println("    --> NULL");
    //			return;
    //		}
    //		for (DSSReference reference : references) {
    //			System.out.println("    --> " + reference.getId() + "/" + reference.getUri() + "/" +
    // reference.getType());
    //			final List<DSSTransform> transforms = reference.getTransforms();
    //			for (DSSTransform transform : transforms) {
    //
    //				System.out.println("    --> ---> " + transform.getElementName() + "/" +
    // transform.getTextContent() + "/" + transform.getAlgorithm());
    //			}
    //		}
    params.setReferences(references);
  }
コード例 #4
0
 private void setAsicMimeType(WSParameters wsParameters, SignatureParameters params) {
   params.aSiC().setMimeType(wsParameters.getAsicMimeType());
 }
コード例 #5
0
  private void setAsicZipComment(WSParameters wsParameters, SignatureParameters params) {

    params.aSiC().setZipComment(wsParameters.getAsicZipComment());
  }
コード例 #6
0
  private void setSignatureLevel(WSParameters wsParameters, SignatureParameters params) {

    final SignatureLevel signatureLevel = wsParameters.getSignatureLevel();
    params.setSignatureLevel(signatureLevel);
  }
コード例 #7
0
  private void setSignaturePackaging(
      final WSParameters wsParameters, final SignatureParameters params) {

    final SignaturePackaging signaturePackaging = wsParameters.getSignaturePackaging();
    params.setSignaturePackaging(signaturePackaging);
  }
コード例 #8
0
  private void setSigningDate(final WSParameters wsParameters, final SignatureParameters params) {

    final Date signingDate = wsParameters.getSigningDate();
    params.bLevel().setSigningDate(signingDate);
  }
コード例 #9
0
  private void setSignerLocation(WSParameters wsParameters, SignatureParameters params) {

    final BLevelParameters.SignerLocation signerLocation = wsParameters.getSignerLocation();
    params.bLevel().setSignerLocation(signerLocation);
  }
コード例 #10
0
  private void setDigestAlgorithm(
      final WSParameters wsParameters, final SignatureParameters params) {

    final DigestAlgorithm digestAlgorithm = wsParameters.getDigestAlgorithm();
    params.setDigestAlgorithm(digestAlgorithm);
  }
コード例 #11
0
  private void setDeterministicId(
      final WSParameters wsParameters, final SignatureParameters params) {

    final String deterministicId = wsParameters.getDeterministicId();
    params.setDeterministicId(deterministicId);
  }
コード例 #12
0
  private void setEncryptionAlgorithm(WSParameters wsParameters, SignatureParameters params) {

    final EncryptionAlgorithm encryptionAlgorithm = wsParameters.getEncryptionAlgorithm();
    params.setEncryptionAlgorithm(encryptionAlgorithm);
  }
コード例 #13
0
  private void setContentIdentifierPrefix(WSParameters wsParameters, SignatureParameters params) {

    final String contentIdentifierPrefix = wsParameters.getContentIdentifierPrefix();
    params.bLevel().setContentIdentifierPrefix(contentIdentifierPrefix);
  }
コード例 #14
0
  private void setCommitmentTypeIndication(WSParameters wsParameters, SignatureParameters params) {

    final List<String> commitmentTypeIndication = wsParameters.getCommitmentTypeIndication();
    params.bLevel().setCommitmentTypeIndications(commitmentTypeIndication);
  }
コード例 #15
0
 private void setAsicSignatureForm(WSParameters wsParameters, SignatureParameters params) {
   params.aSiC().setAsicSignatureForm(wsParameters.getAsicSignatureForm());
 }
コード例 #16
0
  /**
   * Allows to change the default behaviour regarding the use of an expired certificate.
   *
   * @param wsParameters
   * @param params
   */
  private void setSignWithExpiredCertificate(
      final WSParameters wsParameters, final SignatureParameters params) {

    final boolean signWithExpiredCertificate = wsParameters.getSignWithExpiredCertificate();
    params.setSignWithExpiredCertificate(signWithExpiredCertificate);
  }
コード例 #17
0
 private void setAsicEnclosedSignature(WSParameters wsParameters, SignatureParameters params) {
   params.aSiC().setEnclosedSignature(wsParameters.getAsicEnclosedSignature());
 }
コード例 #18
0
  private void setSignaturePolicy(WSParameters wsParameters, SignatureParameters params) {

    final BLevelParameters.Policy signaturePolicy = wsParameters.getSignaturePolicy();
    params.bLevel().setSignaturePolicy(signaturePolicy);
  }