/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: FSNameMappingHandler.java,v 1.3 2008/06/25 05:47:02 qcheng Exp $
*
*/
/**
* Handles <code>ID-FF</code> name identifier mapping.
*/
public class FSNameMappingHandler {
/**
* Construct a <code>FSNameMappingHandler</code> object for a provider.
* @param entityID hosted provider's entity id
* @param hostedDesc hosted provider's meta descriptor
* @param hostedConfig hosted provider's extended meta config
* @param metaAlias hsoted provider's meta alias
*/
public FSNameMappingHandler(
{
this.hostedConfig = hostedConfig;
try {
} catch (FSAccountMgmtException e){
}
}
/**
* Returns <code>NameIdentifier</code> of a provider.
* @param userID user id.
* @param remoteEntityID the provider id whose
* <code>NameIdentifier</code> is to be returned.
* @param local <code>true</code> if <code>remoteProviderID</code> is
* a local provider; <code>false</code> otherwise.
* @return <code>NameIdentifier</code> of an user corresponding to
* <code>remoteProviderID</code>.
* @exception FSAccountMgmtException, SAMLException if an error occurred.
*/
boolean local)
throws FSAccountMgmtException, SAMLException
{
if (local) {
if (nameIdentifier == null) {
nameIdentifier = new NameIdentifier(
}
}
} else {
if (nameIdentifier == null) {
nameIdentifier = new NameIdentifier(
}
}
}
if (nameIdentifier != null &&
{
}
return nameIdentifier;
}
/**
* Returns <code>NameIdentifier</code> of a remote provider.
* @param mappingRequest name ID mapping request object
* @param remoteEntityID the remote provider id whose
* <code>NameIdentifier</code> is to be returned.
* @param local <code>true</code> if <code>remoteProviderID</code> is
* a local provider; <code>false</code> otherwise.
* @return <code>NameIdentifier</code> corresponding to
* <code>remoteProviderID</code>.
* @exception FSAccountMgmtException, SAMLException if an error occurred.
*/
boolean local)
throws FSAccountMgmtException, SAMLException
{
}
/**
* Verifies signature on name identifier mapping response.
* @param elt <code>DOM</code> element which contains
* <code>FSNameIdentifierMappingResopnse</code>
* @param msg <code>SOAPMessage</code> object which contains signed
* name identifier mapping response.
* @param realm the realm in which the provider resides
* @return <code>true</code> if the signature is valid; <code>false</code>
* otherwise.
*/
public static boolean verifyNameIdMappingResponseSignature(
) {
"FSNameMappingHandler.verifyNameIdMappingResponseSignature:Called");
try {
if(metaManager == null) {
"FSNameMappingHandler.verifyNameIdMappingResponseSignature:"
+ " Unable to get meta manager");
return false;
}
+ "verifyNameIdMappingResponseSignature: couldn't obtain "
+ "the cert for signature verification.");
return false;
}
"FSNameMappingHandler.verifyNameIdMappingResponseSignature:"
+ " Provider's cert is found.");
"FSNameMappingHandler.verifyNameIdMappingResponseSignature:"
}
} catch(Exception e){
"FSNameMappingHandler.verifyNameIdMappingResponseSignature: "
+ "Exception occured while verifying signature:", e);
return false;
}
}
}