Search in sources :

Example 1 with XmlCertIDListType

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);
}
Also used : SigningCertificateData(xades4j.properties.data.SigningCertificateData) XmlCertIDListType(xades4j.xml.bind.xades.XmlCertIDListType)

Example 2 with XmlCertIDListType

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);
}
Also used : SigningCertificateData(xades4j.properties.data.SigningCertificateData) XmlCertIDListType(xades4j.xml.bind.xades.XmlCertIDListType)

Example 3 with XmlCertIDListType

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;
}
Also used : XmlDigestAlgAndValueType(xades4j.xml.bind.xades.XmlDigestAlgAndValueType) XmlCertIDType(xades4j.xml.bind.xades.XmlCertIDType) XmlX509IssuerSerialType(xades4j.xml.bind.xmldsig.XmlX509IssuerSerialType) XmlCertIDListType(xades4j.xml.bind.xades.XmlCertIDListType) CertRef(xades4j.properties.data.CertRef) XmlDigestMethodType(xades4j.xml.bind.xmldsig.XmlDigestMethodType)

Example 4 with XmlCertIDListType

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);
}
Also used : XmlCertIDListType(xades4j.xml.bind.xades.XmlCertIDListType) XmlCompleteCertificateRefsType(xades4j.xml.bind.xades.XmlCompleteCertificateRefsType)

Aggregations

XmlCertIDListType (xades4j.xml.bind.xades.XmlCertIDListType)4 SigningCertificateData (xades4j.properties.data.SigningCertificateData)2 CertRef (xades4j.properties.data.CertRef)1 XmlCertIDType (xades4j.xml.bind.xades.XmlCertIDType)1 XmlCompleteCertificateRefsType (xades4j.xml.bind.xades.XmlCompleteCertificateRefsType)1 XmlDigestAlgAndValueType (xades4j.xml.bind.xades.XmlDigestAlgAndValueType)1 XmlDigestMethodType (xades4j.xml.bind.xmldsig.XmlDigestMethodType)1 XmlX509IssuerSerialType (xades4j.xml.bind.xmldsig.XmlX509IssuerSerialType)1