src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java

Print this page




 118                 content.add(unmarshalX509Certificate(childElem));
 119             } else if (localName.equals("X509IssuerSerial")) {
 120                 content.add(new DOMX509IssuerSerial(childElem));
 121             } else if (localName.equals("X509SubjectName")) {
 122                 content.add(childElem.getFirstChild().getNodeValue());
 123             } else if (localName.equals("X509SKI")) {
 124                 try {
 125                     content.add(Base64.decode(childElem));
 126                 } catch (Base64DecodingException bde) {
 127                     throw new MarshalException("cannot decode X509SKI", bde);
 128                 }
 129             } else if (localName.equals("X509CRL")) {
 130                 content.add(unmarshalX509CRL(childElem));
 131             } else {
 132                 content.add(new javax.xml.crypto.dom.DOMStructure(childElem));
 133             }
 134         }
 135         this.content = Collections.unmodifiableList(content);
 136     }
 137 
 138     public List getContent() {
 139         return content;
 140     }
 141 
 142     public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
 143         throws MarshalException
 144     {
 145         Document ownerDoc = DOMUtils.getOwnerDocument(parent);
 146         Element xdElem = DOMUtils.createElement(ownerDoc, "X509Data",
 147                                                 XMLSignature.XMLNS, dsPrefix);
 148 
 149         // append children and preserve order
 150         for (int i = 0, size = content.size(); i < size; i++) {
 151             Object object = content.get(i);
 152             if (object instanceof X509Certificate) {
 153                 marshalCert((X509Certificate)object,xdElem,ownerDoc,dsPrefix);
 154             } else if (object instanceof XMLStructure) {
 155                 if (object instanceof X509IssuerSerial) {
 156                     ((DOMX509IssuerSerial)object).marshal
 157                         (xdElem, dsPrefix, context);
 158                 } else {




 118                 content.add(unmarshalX509Certificate(childElem));
 119             } else if (localName.equals("X509IssuerSerial")) {
 120                 content.add(new DOMX509IssuerSerial(childElem));
 121             } else if (localName.equals("X509SubjectName")) {
 122                 content.add(childElem.getFirstChild().getNodeValue());
 123             } else if (localName.equals("X509SKI")) {
 124                 try {
 125                     content.add(Base64.decode(childElem));
 126                 } catch (Base64DecodingException bde) {
 127                     throw new MarshalException("cannot decode X509SKI", bde);
 128                 }
 129             } else if (localName.equals("X509CRL")) {
 130                 content.add(unmarshalX509CRL(childElem));
 131             } else {
 132                 content.add(new javax.xml.crypto.dom.DOMStructure(childElem));
 133             }
 134         }
 135         this.content = Collections.unmodifiableList(content);
 136     }
 137 
 138     public List<Object> getContent() {
 139         return content;
 140     }
 141 
 142     public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
 143         throws MarshalException
 144     {
 145         Document ownerDoc = DOMUtils.getOwnerDocument(parent);
 146         Element xdElem = DOMUtils.createElement(ownerDoc, "X509Data",
 147                                                 XMLSignature.XMLNS, dsPrefix);
 148 
 149         // append children and preserve order
 150         for (int i = 0, size = content.size(); i < size; i++) {
 151             Object object = content.get(i);
 152             if (object instanceof X509Certificate) {
 153                 marshalCert((X509Certificate)object,xdElem,ownerDoc,dsPrefix);
 154             } else if (object instanceof XMLStructure) {
 155                 if (object instanceof X509IssuerSerial) {
 156                     ((DOMX509IssuerSerial)object).marshal
 157                         (xdElem, dsPrefix, context);
 158                 } else {