blob: 1448876552510fd0443b64c134486d1584275c12 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>CommonUtil (Apache Rampart)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CommonUtil (Apache Rampart)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CommonUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/rahas/impl/util/AxiomParserPool.html" title="class in org.apache.rahas.impl.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/rahas/impl/util/SAML2KeyInfo.html" title="class in org.apache.rahas.impl.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/rahas/impl/util/CommonUtil.html" target="_top">Frames</a></li>
<li><a href="CommonUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.rahas.impl.util</div>
<h2 title="Class CommonUtil" class="title">Class CommonUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.rahas.impl.util.CommonUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">CommonUtil</span>
extends <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">This class implements some utility methods common to SAML1 and SAML2.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#CommonUtil()">CommonUtil</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Certificate.html?is-external=true" title="class or interface in java.security.cert">X509Certificate</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getCertificateByAlias(org.apache.ws.security.components.crypto.Crypto, java.lang.String)">getCertificateByAlias</a></strong>(org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)</code>
<div class="block">Gets the certificates chain by alias.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Certificate.html?is-external=true" title="class or interface in java.security.cert">X509Certificate</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getCertificatesByAlias(org.apache.ws.security.components.crypto.Crypto, java.lang.String)">getCertificatesByAlias</a></strong>(org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)</code>
<div class="block">Gets the certificates chain by alias.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.apache.ws.security.components.crypto.Crypto</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getCrypto(java.util.Properties, java.lang.ClassLoader)">getCrypto</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>&nbsp;properties,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;classLoader)</code>
<div class="block">Constructs crypto configuration based on the given properties.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static org.apache.ws.security.components.crypto.Crypto</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getCrypto(java.lang.String, java.lang.ClassLoader)">getCrypto</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;propertiesFile,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;classLoader)</code>
<div class="block">Constructs crypto configuration based on the given properties.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getDecryptedBytes(javax.security.auth.callback.CallbackHandler, org.apache.ws.security.components.crypto.Crypto, org.w3c.dom.Node)">getDecryptedBytes</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/security/auth/callback/CallbackHandler.html?is-external=true" title="class or interface in javax.security.auth.callback">CallbackHandler</a>&nbsp;callbackHandler,
org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;encryptedKeyElement)</code>
<div class="block">Decrypts the EncryptedKey element and returns the secret that was used.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getOMDOMDocument()">getOMDOMDocument</a></strong>()</code>
<div class="block">This method creates a DOM compatible Axiom document.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CommonUtil()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CommonUtil</h4>
<pre>public&nbsp;CommonUtil()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getOMDOMDocument()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOMDOMDocument</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;getOMDOMDocument()
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">This method creates a DOM compatible Axiom document.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>DOM compatible Axiom document</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred while creating the Document.</dd></dl>
</li>
</ul>
<a name="getCertificateByAlias(org.apache.ws.security.components.crypto.Crypto, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCertificateByAlias</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Certificate.html?is-external=true" title="class or interface in java.security.cert">X509Certificate</a>&nbsp;getCertificateByAlias(org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Gets the certificates chain by alias. Always returns the first certificate if a certificate chain is found.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>crypto</code> - Crypto to lookup certificate.</dd><dd><code>alias</code> - Alias name.</dd>
<dt><span class="strong">Returns:</span></dt><dd>X509 certificate object.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred
while retrieving the certificate or if no certificates are found for given alias.</dd></dl>
</li>
</ul>
<a name="getCertificatesByAlias(org.apache.ws.security.components.crypto.Crypto, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCertificatesByAlias</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Certificate.html?is-external=true" title="class or interface in java.security.cert">X509Certificate</a>[]&nbsp;getCertificatesByAlias(org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Gets the certificates chain by alias. If no certificates are found return an empty array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>crypto</code> - Crypto to lookup certificate.</dd><dd><code>alias</code> - Alias name.</dd>
<dt><span class="strong">Returns:</span></dt><dd>X509 certificates array.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred
while retrieving the certificate.</dd></dl>
</li>
</ul>
<a name="getDecryptedBytes(javax.security.auth.callback.CallbackHandler, org.apache.ws.security.components.crypto.Crypto, org.w3c.dom.Node)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDecryptedBytes</h4>
<pre>public static&nbsp;byte[]&nbsp;getDecryptedBytes(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/security/auth/callback/CallbackHandler.html?is-external=true" title="class or interface in javax.security.auth.callback">CallbackHandler</a>&nbsp;callbackHandler,
org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;encryptedKeyElement)
throws org.apache.ws.security.WSSecurityException</pre>
<div class="block">Decrypts the EncryptedKey element and returns the secret that was used.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callbackHandler</code> - Callback handler to pass to WSS4J framework.</dd><dd><code>crypto</code> - To get private key information.</dd><dd><code>encryptedKeyElement</code> - The encrypted Key element.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The secret as a byte stream.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>org.apache.ws.security.WSSecurityException</code> - If an error is occurred while decrypting the element.</dd></dl>
</li>
</ul>
<a name="getCrypto(java.util.Properties, java.lang.ClassLoader)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCrypto</h4>
<pre>public static&nbsp;org.apache.ws.security.components.crypto.Crypto&nbsp;getCrypto(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>&nbsp;properties,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;classLoader)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Constructs crypto configuration based on the given properties. Provider is instantiated using
given class loader.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>properties</code> - Crypto configuration properties.</dd><dd><code>classLoader</code> - Class loader used to create provider.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A crypto object.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred while creating the Crypto object.</dd></dl>
</li>
</ul>
<a name="getCrypto(java.lang.String, java.lang.ClassLoader)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getCrypto</h4>
<pre>public static&nbsp;org.apache.ws.security.components.crypto.Crypto&nbsp;getCrypto(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;propertiesFile,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;classLoader)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Constructs crypto configuration based on the given properties. Provider is instantiated using
given class loader.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertiesFile</code> - Crypto configuration properties file name.</dd><dd><code>classLoader</code> - Class loader used to create provider.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A crypto object.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred while creating the Crypto object.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CommonUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/rahas/impl/util/AxiomParserPool.html" title="class in org.apache.rahas.impl.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/rahas/impl/util/SAML2KeyInfo.html" title="class in org.apache.rahas.impl.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/rahas/impl/util/CommonUtil.html" target="_top">Frames</a></li>
<li><a href="CommonUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &copy; <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>