use of xades4j.xml.bind.xades.XmlCertIDListType in project xades4j by luisgoncalves.
the class FromXmlSigningCertificateConverter method convertFromObjectTree.
@Override
public void convertFromObjectTree(XmlSignedSignaturePropertiesType xmlProps, QualifyingPropertiesDataCollector propertyDataCollector) throws PropertyUnmarshalException {
XmlCertIDListType xmlSigningCertificate = xmlProps.getSigningCertificate();
if (null == xmlSigningCertificate)
return;
SigningCertificateData signingCertData = new SigningCertificateData();
FromXmlUtils.createAndCertificateRefs(xmlSigningCertificate, signingCertData);
propertyDataCollector.setSigningCertificate(signingCertData);
}
use of xades4j.xml.bind.xades.XmlCertIDListType in project xades4j by luisgoncalves.
the class ToXmlSigningCertificateConverter method convertIntoObjectTree.
@Override
public void convertIntoObjectTree(PropertyDataObject propData, XmlSignedPropertiesType xmlProps, Document doc) {
SigningCertificateData signCertData = (SigningCertificateData) propData;
XmlCertIDListType xmlSigningCertificateProp = ToXmlUtils.getXmlCertRefList(signCertData);
xmlProps.getSignedSignatureProperties().setSigningCertificate(xmlSigningCertificateProp);
}
use of xades4j.xml.bind.xades.XmlCertIDListType in project xades4j by luisgoncalves.
the class ToXmlUtils method getXmlCertRefList.
/**/
static XmlCertIDListType getXmlCertRefList(BaseCertRefsData certRefsData) {
XmlCertIDListType xmlCertRefListProp = new XmlCertIDListType();
List<XmlCertIDType> xmlCertRefList = xmlCertRefListProp.getCert();
XmlDigestAlgAndValueType certDigest;
XmlDigestMethodType certDigestMethod;
XmlX509IssuerSerialType issuerSerial;
XmlCertIDType certID;
for (CertRef certRef : certRefsData.getCertRefs()) {
certDigestMethod = new XmlDigestMethodType();
certDigestMethod.setAlgorithm(certRef.digestAlgUri);
certDigest = new XmlDigestAlgAndValueType();
certDigest.setDigestMethod(certDigestMethod);
certDigest.setDigestValue(certRef.digestValue);
issuerSerial = new XmlX509IssuerSerialType();
issuerSerial.setX509IssuerName(certRef.issuerDN);
issuerSerial.setX509SerialNumber(certRef.serialNumber);
certID = new XmlCertIDType();
certID.setCertDigest(certDigest);
certID.setIssuerSerial(issuerSerial);
xmlCertRefList.add(certID);
}
return xmlCertRefListProp;
}
use of xades4j.xml.bind.xades.XmlCertIDListType in project xades4j by luisgoncalves.
the class ToXmlCompleteCertRefsConverter method convertIntoObjectTree.
@Override
public void convertIntoObjectTree(PropertyDataObject propData, XmlUnsignedPropertiesType xmlProps, Document doc) {
XmlCertIDListType xmlCertRefsList = ToXmlUtils.getXmlCertRefList((CompleteCertificateRefsData) propData);
XmlCompleteCertificateRefsType xmlCompleteCertRefsProp = new XmlCompleteCertificateRefsType();
xmlCompleteCertRefsProp.setCertRefs(xmlCertRefsList);
xmlProps.getUnsignedSignatureProperties().setCompleteCertificateRefs(xmlCompleteCertRefsProp);
}
Aggregations