/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6436919 6460930
* @summary check that XML Signatures can be generated and validated with
* SecurityManager enabled and default policy
* @author Sean Mullan
*/
dbf.setNamespaceAware(true);
}
public void run() {
try {
for (int i=0; i<2; i++) {
s.setTcpNoDelay(true);
new BufferedOutputStream(
s.getOutputStream() ));
// don't close the connection immediately as otherwise
// the http headers may not have been received and the
// http client will re-connect.
s.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
setup();
("http://example.org/envelope", "Envelope");
"xmlns", "http://example.org/envelope");
// the policy only grants this test SocketPermission to accept, resolve
// and connect to localhost so that it can dereference 2nd reference
try {
// generate a signature with SecurityManager enabled
("", sha1,
+ "/anything.txt", sha1));
// validate a signature with SecurityManager enabled
// disable secure validation mode so that http reference will work
throw new Exception
("XMLDSigWithSecMgr signature validation FAILED");
}
} catch (SecurityException se) {
}
}
new XMLDSigWithSecMgr();
}
}