blob: 3b50358c2f54c7652f666512eff4f753d9c1032b [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 org.opensaml.xml.XMLObject</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#buildXMLObject(javax.xml.namespace.QName)">buildXMLObject</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/namespace/QName.html?is-external=true" title="class or interface in javax.xml.namespace">QName</a>&nbsp;objectQName)</code>
<div class="block">Builds the requested XMLObject.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#createTokenIssuerConfiguration(org.apache.axiom.om.OMElement)">createTokenIssuerConfiguration</a></strong>(org.apache.axiom.om.OMElement&nbsp;configElement)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#createTokenIssuerConfiguration(org.apache.axis2.description.Parameter)">createTokenIssuerConfiguration</a></strong>(org.apache.axis2.description.Parameter&nbsp;messageContextParameter)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#createTokenIssuerConfiguration(java.lang.String)">createTokenIssuerConfiguration</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;configFile)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.opensaml.xml.signature.KeyInfo</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getCertificateBasedKeyInfo(java.security.cert.X509Certificate)">getCertificateBasedKeyInfo</a></strong>(<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;certificate)</code>
<div class="block">Creates the certificate based KeyInfo object.</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#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="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#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="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.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="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.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="rowColor">
<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="altColor">
<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>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/rahas/impl/util/SAMLCallbackHandler.html" title="interface in org.apache.rahas.impl.util">SAMLCallbackHandler</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getSAMLCallbackHandler(org.apache.rahas.impl.SAMLTokenIssuerConfig, org.apache.rahas.RahasData)">getSAMLCallbackHandler</a></strong>(<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;tokenIssuerConfiguration,
<a href="../../../../../org/apache/rahas/RahasData.html" title="class in org.apache.rahas">RahasData</a>&nbsp;data)</code>
<div class="block">Gets the SAML callback handler.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.opensaml.xml.signature.KeyInfo</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getSymmetricKeyBasedKeyInfo(org.w3c.dom.Document, org.apache.rahas.RahasData, java.security.cert.X509Certificate, int, org.apache.ws.security.components.crypto.Crypto, int)">getSymmetricKeyBasedKeyInfo</a></strong>(<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;doc,
<a href="../../../../../org/apache/rahas/RahasData.html" title="class in org.apache.rahas">RahasData</a>&nbsp;data,
<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;serviceCert,
int&nbsp;keySize,
org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
int&nbsp;keyComputation)</code>
<div class="block">This method creates KeyInfo element of an assertion.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/rahas/impl/util/CommonUtil.html#getTokenIssuerConfiguration(org.apache.axiom.om.OMElement, java.lang.String, org.apache.axis2.description.Parameter)">getTokenIssuerConfiguration</a></strong>(org.apache.axiom.om.OMElement&nbsp;configElement,
<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;configFile,
org.apache.axis2.description.Parameter&nbsp;messageContextParameter)</code>
<div class="block">Creates the token issuer configuration.</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="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/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>
<a name="getTokenIssuerConfiguration(org.apache.axiom.om.OMElement, java.lang.String, org.apache.axis2.description.Parameter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTokenIssuerConfiguration</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;getTokenIssuerConfiguration(org.apache.axiom.om.OMElement&nbsp;configElement,
<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;configFile,
org.apache.axis2.description.Parameter&nbsp;messageContextParameter)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Creates the token issuer configuration. The configuration is created in following order,
1. Try create token configuration using configuration OMElement
2. Try create token configuration using a configuration file name
3. Try create token configuration using a parameter name in message context.
The issuer configuration would look like as follows,
<saml-issuer-config>
<issuerName>Test_STS</issuerName>
<issuerKeyAlias>ip</issuerKeyAlias>
<issuerKeyPassword>password</issuerKeyPassword>
<cryptoProperties>
<crypto provider="org.apache.ws.security.components.crypto.Merlin">
<property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</property>
<property name="org.apache.ws.security.crypto.merlin.file">META-INF/rahas-sts.jks</property>
<property name="org.apache.ws.security.crypto.merlin.keystore.password">password</property>
</crypto>
</cryptoProperties>
<timeToLive>300000</timeToLive>
<keySize>256</keySize>
<addRequestedAttachedRef />
<addRequestedUnattachedRef />
<keyComputation>2</keyComputation>
<proofKeyType>BinarySecret</proofKeyType>
<trusted-services>
<service alias="bob">http://localhost:8080/axis2/services/STS</service>
</trusted-services>
</saml-issuer-config></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>configElement</code> - Configuration as an OMElement.</dd><dd><code>configFile</code> - Configuration as a file.</dd><dd><code>messageContextParameter</code> - Configuration as a message context parameter.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Token issuer configuration as a SAMLTokenIssuerConfig 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 SAMLTokenIssuerConfig object.</dd></dl>
</li>
</ul>
<a name="createTokenIssuerConfiguration(org.apache.axiom.om.OMElement)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createTokenIssuerConfiguration</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;createTokenIssuerConfiguration(org.apache.axiom.om.OMElement&nbsp;configElement)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<dl><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></dd></dl>
</li>
</ul>
<a name="createTokenIssuerConfiguration(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createTokenIssuerConfiguration</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;createTokenIssuerConfiguration(<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;configFile)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<dl><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></dd></dl>
</li>
</ul>
<a name="createTokenIssuerConfiguration(org.apache.axis2.description.Parameter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createTokenIssuerConfiguration</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;createTokenIssuerConfiguration(org.apache.axis2.description.Parameter&nbsp;messageContextParameter)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<dl><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></dd></dl>
</li>
</ul>
<a name="buildXMLObject(javax.xml.namespace.QName)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildXMLObject</h4>
<pre>public static&nbsp;org.opensaml.xml.XMLObject&nbsp;buildXMLObject(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/namespace/QName.html?is-external=true" title="class or interface in javax.xml.namespace">QName</a>&nbsp;objectQName)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Builds the requested XMLObject.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>objectQName</code> - name of the XMLObject</dd>
<dt><span class="strong">Returns:</span></dt><dd>the build XMLObject</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 unable to find the appropriate builder.</dd></dl>
</li>
</ul>
<a name="getSymmetricKeyBasedKeyInfo(org.w3c.dom.Document, org.apache.rahas.RahasData, java.security.cert.X509Certificate, int, org.apache.ws.security.components.crypto.Crypto, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSymmetricKeyBasedKeyInfo</h4>
<pre>public static&nbsp;org.opensaml.xml.signature.KeyInfo&nbsp;getSymmetricKeyBasedKeyInfo(<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;doc,
<a href="../../../../../org/apache/rahas/RahasData.html" title="class in org.apache.rahas">RahasData</a>&nbsp;data,
<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;serviceCert,
int&nbsp;keySize,
org.apache.ws.security.components.crypto.Crypto&nbsp;crypto,
int&nbsp;keyComputation)
throws org.apache.ws.security.WSSecurityException,
<a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">This method creates KeyInfo element of an assertion. This is a facade, in which it calls
to other helper methods to create KeyInfo. The TokenIssuer will call this method to
create the KeyInfo.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>doc</code> - An Axiom based DOM Document.</dd><dd><code>data</code> - The ephemeral key which we use here need in encrypting the message also. Therefore
we need to save the ephemeral key in RahasData passed here.</dd><dd><code>serviceCert</code> - Public key used to encrypt the assertion is extracted from this certificate.</dd><dd><code>keySize</code> - Size of the key to be used</dd><dd><code>crypto</code> - The relevant private key</dd><dd><code>keyComputation</code> - Key computation mechanism.</dd>
<dt><span class="strong">Returns:</span></dt><dd>OpenSAML KeyInfo representation.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>org.apache.ws.security.WSSecurityException</code> - We use WSS4J to generate encrypted key. This exception will trigger if an
error occurs while generating the encrypted key.</dd>
<dd><code><a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></code> - If an error occurred while creating KeyInfo object.</dd></dl>
</li>
</ul>
<a name="getCertificateBasedKeyInfo(java.security.cert.X509Certificate)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCertificateBasedKeyInfo</h4>
<pre>public static&nbsp;org.opensaml.xml.signature.KeyInfo&nbsp;getCertificateBasedKeyInfo(<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;certificate)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Creates the certificate based KeyInfo object.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>certificate</code> - The public key certificate used to create the KeyInfo object.</dd>
<dt><span class="strong">Returns:</span></dt><dd>OpenSAML representation of KeyInfo 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 KeyInfo</dd></dl>
</li>
</ul>
<a name="getSAMLCallbackHandler(org.apache.rahas.impl.SAMLTokenIssuerConfig, org.apache.rahas.RahasData)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getSAMLCallbackHandler</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/rahas/impl/util/SAMLCallbackHandler.html" title="interface in org.apache.rahas.impl.util">SAMLCallbackHandler</a>&nbsp;getSAMLCallbackHandler(<a href="../../../../../org/apache/rahas/impl/SAMLTokenIssuerConfig.html" title="class in org.apache.rahas.impl">SAMLTokenIssuerConfig</a>&nbsp;tokenIssuerConfiguration,
<a href="../../../../../org/apache/rahas/RahasData.html" title="class in org.apache.rahas">RahasData</a>&nbsp;data)
throws <a href="../../../../../org/apache/rahas/TrustException.html" title="class in org.apache.rahas">TrustException</a></pre>
<div class="block">Gets the SAML callback handler. First checks whether there is a registered callback handler in token
issuer configuration. If not this will check whether there is a callback class configured in token issuer
configuration. If class name is specified this method will create an object of the class and will return.
If class name is also not specified this method will return null.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>tokenIssuerConfiguration</code> - The SAML token issuer configuration.</dd><dd><code>data</code> - The RahasData.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The SAMLCallbackHandler if configured in token issuer configuration, else null.</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 loading class from class loader</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>