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); }
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); } } }
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); }
private void setAsicMimeType(WSParameters wsParameters, SignatureParameters params) { params.aSiC().setMimeType(wsParameters.getAsicMimeType()); }
private void setAsicZipComment(WSParameters wsParameters, SignatureParameters params) { params.aSiC().setZipComment(wsParameters.getAsicZipComment()); }
private void setSignatureLevel(WSParameters wsParameters, SignatureParameters params) { final SignatureLevel signatureLevel = wsParameters.getSignatureLevel(); params.setSignatureLevel(signatureLevel); }
private void setSignaturePackaging( final WSParameters wsParameters, final SignatureParameters params) { final SignaturePackaging signaturePackaging = wsParameters.getSignaturePackaging(); params.setSignaturePackaging(signaturePackaging); }
private void setSigningDate(final WSParameters wsParameters, final SignatureParameters params) { final Date signingDate = wsParameters.getSigningDate(); params.bLevel().setSigningDate(signingDate); }
private void setSignerLocation(WSParameters wsParameters, SignatureParameters params) { final BLevelParameters.SignerLocation signerLocation = wsParameters.getSignerLocation(); params.bLevel().setSignerLocation(signerLocation); }
private void setDigestAlgorithm( final WSParameters wsParameters, final SignatureParameters params) { final DigestAlgorithm digestAlgorithm = wsParameters.getDigestAlgorithm(); params.setDigestAlgorithm(digestAlgorithm); }
private void setDeterministicId( final WSParameters wsParameters, final SignatureParameters params) { final String deterministicId = wsParameters.getDeterministicId(); params.setDeterministicId(deterministicId); }
private void setEncryptionAlgorithm(WSParameters wsParameters, SignatureParameters params) { final EncryptionAlgorithm encryptionAlgorithm = wsParameters.getEncryptionAlgorithm(); params.setEncryptionAlgorithm(encryptionAlgorithm); }
private void setContentIdentifierPrefix(WSParameters wsParameters, SignatureParameters params) { final String contentIdentifierPrefix = wsParameters.getContentIdentifierPrefix(); params.bLevel().setContentIdentifierPrefix(contentIdentifierPrefix); }
private void setCommitmentTypeIndication(WSParameters wsParameters, SignatureParameters params) { final List<String> commitmentTypeIndication = wsParameters.getCommitmentTypeIndication(); params.bLevel().setCommitmentTypeIndications(commitmentTypeIndication); }
private void setAsicSignatureForm(WSParameters wsParameters, SignatureParameters params) { params.aSiC().setAsicSignatureForm(wsParameters.getAsicSignatureForm()); }
/** * 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); }
private void setAsicEnclosedSignature(WSParameters wsParameters, SignatureParameters params) { params.aSiC().setEnclosedSignature(wsParameters.getAsicEnclosedSignature()); }
private void setSignaturePolicy(WSParameters wsParameters, SignatureParameters params) { final BLevelParameters.Policy signaturePolicy = wsParameters.getSignaturePolicy(); params.bLevel().setSignaturePolicy(signaturePolicy); }