public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException { Document ownerDoc = DOMUtils.getOwnerDocument(parent); Element xdElem = DOMUtils.createElement(ownerDoc, "X509Data", XMLSignature.XMLNS, dsPrefix); // append children and preserve order for (int i = 0, size = content.size(); i < size; i++) { Object object = content.get(i); if (object instanceof X509Certificate) { marshalCert((X509Certificate)object,xdElem,ownerDoc,dsPrefix); } else if (object instanceof XMLStructure) { if (object instanceof X509IssuerSerial) { ((DOMX509IssuerSerial)object).marshal (xdElem, dsPrefix, context); } else { javax.xml.crypto.dom.DOMStructure domContent = (javax.xml.crypto.dom.DOMStructure)object; DOMUtils.appendChild(xdElem, domContent.getNode()); } } else if (object instanceof byte[]) { marshalSKI((byte[])object, xdElem, ownerDoc, dsPrefix); } else if (object instanceof String) { marshalSubjectName((String)object, xdElem, ownerDoc,dsPrefix); } else if (object instanceof X509CRL) { marshalCRL((X509CRL)object, xdElem, ownerDoc, dsPrefix); } } parent.appendChild(xdElem); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof X509IssuerSerial)) { return false; } X509IssuerSerial ois = (X509IssuerSerial)obj; return (issuerName.equals(ois.getIssuerName()) && serialNumber.equals(ois.getSerialNumber())); }
/** * Marshals an {@link X509IssuerSerial} * * @param xwriter * @param issuerSerial * @param dsPrefix */ public static void marshalX509IssuerSerial(XmlWriter xwriter, X509IssuerSerial issuerSerial, String dsPrefix) { xwriter.writeStartElement(dsPrefix, "X509IssuerSerial", XMLSignature.XMLNS); xwriter.writeTextElement(dsPrefix, "X509IssuerName", XMLSignature.XMLNS, issuerSerial.getIssuerName()); xwriter.writeTextElement(dsPrefix, "X509SerialNumber", XMLSignature.XMLNS, issuerSerial.getSerialNumber().toString()); xwriter.writeEndElement(); // "X509IssuerSerial" }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof X509IssuerSerial)) { return false; } X509IssuerSerial ois = (X509IssuerSerial)obj; return issuerName.equals(ois.getIssuerName()) && serialNumber.equals(ois.getSerialNumber()); }
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException { Document ownerDoc = DOMUtils.getOwnerDocument(parent); Element xdElem = DOMUtils.createElement (ownerDoc, "X509Data", XMLSignature.XMLNS, dsPrefix); // append children and preserve order for (int i = 0, size = content.size(); i < size; i++) { Object object = content.get(i); if (object instanceof X509Certificate) { marshalCert((X509Certificate) object,xdElem,ownerDoc,dsPrefix); } else if (object instanceof XMLStructure) { if (object instanceof X509IssuerSerial) { ((DOMX509IssuerSerial) object).marshal (xdElem, dsPrefix, context); } else { javax.xml.crypto.dom.DOMStructure domContent = (javax.xml.crypto.dom.DOMStructure) object; DOMUtils.appendChild(xdElem, domContent.getNode()); } } else if (object instanceof byte[]) { marshalSKI((byte[]) object, xdElem, ownerDoc, dsPrefix); } else if (object instanceof String) { marshalSubjectName((String) object, xdElem, ownerDoc,dsPrefix); } else if (object instanceof X509CRL) { marshalCRL((X509CRL) object, xdElem, ownerDoc, dsPrefix); } } parent.appendChild(xdElem); }
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof X509IssuerSerial)) { return false; } X509IssuerSerial ois = (X509IssuerSerial) obj; return (issuerName.equals(ois.getIssuerName()) && serialNumber.equals(ois.getSerialNumber())); }
@Override public void marshalObject(XmlWriter xwriter, X509IssuerSerial toMarshal, String dsPrefix, XMLCryptoContext context) throws MarshalException { Marshaller.marshalX509IssuerSerial( xwriter, toMarshal, dsPrefix); }