use of xades4j.xml.bind.xmldsig.XmlX509IssuerSerialType 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.xmldsig.XmlX509IssuerSerialType in project xades4j by luisgoncalves.
the class FromXmlUtils method createAndCertificateRefs.
static void createAndCertificateRefs(XmlCertIDListType xmlCertRefs, BaseCertRefsData certRefsData) {
for (XmlCertIDType xmlCertIDType : xmlCertRefs.getCert()) {
/* All the elements within Cert are marked with 'required' */
XmlX509IssuerSerialType is = xmlCertIDType.getIssuerSerial();
XmlDigestAlgAndValueType d = xmlCertIDType.getCertDigest();
CertRef ref = new CertRef(is.getX509IssuerName(), is.getX509SerialNumber(), d.getDigestMethod().getAlgorithm(), // Digest value is already decoded.
d.getDigestValue());
certRefsData.addCertRef(ref);
}
}
Aggregations