jdk/test/javax/xml/crypto/dsig/ValidationTests.java
author chegar
Thu, 06 May 2010 17:17:09 +0100
changeset 5463 ad2d35ddcf37
parent 3462 4477fb399895
child 5506 202f599c92aa
permissions -rw-r--r--
6946825: com.sun.net.httpserver.HttpServer; Memory Leak on Non HTTP conform open socket Reviewed-by: michaelm
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
3462
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
     2
 * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
3462
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
    26
 * @bug 4635230 6365103 6366054 6824440
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Basic unit tests for validating XML Signatures with JSR 105
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *     X509KeySelector.java ValidationTests.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * @run main ValidationTests
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @author Sean Mullan
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.FileInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.security.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.xml.crypto.Data;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.xml.crypto.KeySelector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.xml.crypto.OctetStreamData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import javax.xml.crypto.URIDereferencer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import javax.xml.crypto.URIReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import javax.xml.crypto.URIReferenceException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import javax.xml.crypto.XMLCryptoContext;
3462
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
    43
import javax.xml.crypto.dsig.XMLSignatureException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.xml.crypto.dsig.XMLSignatureFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * This is a testcase to validate all "merlin-xmldsig-twenty-three"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * testcases from Baltimore
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
public class ValidationTests {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    private static SignatureValidator validator;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    private final static String DIR = System.getProperty("test.src", ".");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    private final static String DATA_DIR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        DIR + System.getProperty("file.separator") + "data";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private final static String KEYSTORE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        DATA_DIR + System.getProperty("file.separator") + "certs" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        System.getProperty("file.separator") + "xmldsig.jks";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private final static String STYLESHEET =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        "http://www.w3.org/TR/xml-stylesheet";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private final static String STYLESHEET_B64 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        "http://www.w3.org/Signature/2002/04/xml-stylesheet.b64";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    private final static String[] FILES = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        "signature-enveloped-dsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        "signature-enveloping-b64-dsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        "signature-enveloping-dsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        "signature-enveloping-rsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        "signature-enveloping-hmac-sha1.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        "signature-external-dsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        "signature-external-b64-dsa.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        "signature-retrievalmethod-rawx509crt.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        "signature-keyname.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        "signature-x509-crt-crl.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        "signature-x509-crt.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        "signature-x509-is.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        "signature-x509-ski.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        "signature-x509-sn.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
//      "signature.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        "exc-signature.xml",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        "sign-spec.xml"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    static KeySelector skks;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            skks =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                new KeySelectors.SecretKeySelector("secret".getBytes("ASCII"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            //should not occur
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    private final static KeySelector SKKS = skks;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    private final static KeySelector KVKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        new KeySelectors.KeyValueKeySelector();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    private final static KeySelector CKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        new KeySelectors.CollectionKeySelector(new File(DATA_DIR));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    private final static KeySelector RXKS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        new KeySelectors.RawX509KeySelector();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    private final static KeySelector XKS = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    private final static KeySelector[] KEY_SELECTORS = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        SKKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        CKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        CKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        RXKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        RXKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        CKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        CKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        CKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
//        XKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        KVKS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        RXKS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    private static URIDereferencer httpUd = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public static void main(String args[]) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        httpUd = new HttpURIDereferencer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        validator = new SignatureValidator(new File(DATA_DIR));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        boolean atLeastOneFailed = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        for (int i=0; i < FILES.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            System.out.println("Validating " + FILES[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            if (test_signature(FILES[i], KEY_SELECTORS[i])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                System.out.println("PASSED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                System.out.println("FAILED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                atLeastOneFailed = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        // test with reference caching enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        System.out.println("Validating sign-spec.xml with caching enabled");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        if (test_signature("sign-spec.xml", RXKS, true)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            System.out.println("PASSED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            System.out.println("FAILED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            atLeastOneFailed = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
3462
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   146
        System.out.println("Validating signature-enveloping-hmac-sha1-40.xml");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   147
        try {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   148
            test_signature("signature-enveloping-hmac-sha1-40.xml", SKKS, false);
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   149
            System.out.println("FAILED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   150
            atLeastOneFailed = true;
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   151
        } catch (XMLSignatureException xse) {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   152
            System.out.println(xse.getMessage());
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   153
            System.out.println("PASSED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   154
        }
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   155
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   156
        System.out.println("Validating signature-enveloping-hmac-sha1-trunclen-0-attack.xml");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   157
        try {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   158
            test_signature("signature-enveloping-hmac-sha1-trunclen-0-attack.xml", SKKS, false);
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   159
            System.out.println("FAILED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   160
            atLeastOneFailed = true;
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   161
        } catch (XMLSignatureException xse) {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   162
            System.out.println(xse.getMessage());
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   163
            System.out.println("PASSED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   164
        }
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   165
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   166
        System.out.println("Validating signature-enveloping-hmac-sha1-trunclen-8-attack.xml");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   167
        try {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   168
            test_signature("signature-enveloping-hmac-sha1-trunclen-8-attack.xml", SKKS, false);
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   169
            System.out.println("FAILED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   170
            atLeastOneFailed = true;
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   171
        } catch (XMLSignatureException xse) {
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   172
            System.out.println(xse.getMessage());
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   173
            System.out.println("PASSED");
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   174
        }
4477fb399895 6824440: XML Signature HMAC issue
mullan
parents: 2
diff changeset
   175
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        if (atLeastOneFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            throw new Exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                ("At least one signature did not validate as expected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    public static boolean test_signature(String file, KeySelector ks)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        return test_signature(file, ks, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public static boolean test_signature(String file, KeySelector ks,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        boolean cache) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        if (ks == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            KeyStore keystore = KeyStore.getInstance("JKS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            keystore.load
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                (new FileInputStream(KEYSTORE), "changeit".toCharArray());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            ks = new X509KeySelector(keystore, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        return validator.validate(file, ks, httpUd, cache);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * This URIDereferencer returns locally cached copies of http content to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * avoid test failures due to network glitches, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    private static class HttpURIDereferencer implements URIDereferencer {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        private URIDereferencer defaultUd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        HttpURIDereferencer() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            defaultUd = XMLSignatureFactory.getInstance().getURIDereferencer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        public Data dereference(final URIReference ref, XMLCryptoContext ctx)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        throws URIReferenceException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            String uri = ref.getURI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                    FileInputStream fis = new FileInputStream(new File
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                        (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                    return new OctetStreamData(fis,ref.getURI(),ref.getType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                } catch (Exception e) { throw new URIReferenceException(e); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            // fallback on builtin deref
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            return defaultUd.dereference(ref, ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
}