KeyIdentifier.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: KeyIdentifier.java,v 1.4 2008/07/30 05:00:44 mallas Exp $
*
*/
/**
* This class <code>KeyIdentifier</code> can be be used to insert the
* key identifier information into <code>SecurityTokenReference</code>.
*/
public class KeyIdentifier {
/**
* Constructor.
*
* @param valueType the value type of the key value.
*
* @param encodingType the encoding type of the key value
*
* @param value the key identifier value.
*/
this.encodingType = encodingType;
}
/**
* Constructor
* @param element KeyIdentifier element
*
* @exception SecurityException if the element parsing is failed.
*/
throw new IllegalArgumentException(
}
throw new SecurityException(
}
" have ValueType or EncodingType");
throw new SecurityException(
}
}
/**
* Returns the <code>X509Certficate</code> for the value set in the
* key identifier.
*/
return cert;
}
return cert;
}
/**
* Returns the value type set in the key identifier.
*
* @return the value type.
*/
public String getValueType() {
return valueType;
}
/**
* Returns the encoding type in the key identifier.
*
* @return the encoding type.
*/
public String getEncodingType() {
return encodingType;
}
/**
* Returns the key identifier reference value.
*
* @return the key identifier reference value.
*/
public String getReferenceValue() {
return value;
}
/**
* Return the value in the key identifier.
* @return the value in the keu identifier.
*/
return value;
}
/**
* Sets the value in the key identifier.
* @param value the value in the key identifier.
*/
}
/**
* Returns the id.
* @return the id.
*/
return id;
}
/**
* Returns the security token that is referenced via the key identifier.
* @param doc the SOAPMessage XML document
* @return the security token element matches with the assertion.
* @exception SecurityException if there is a failure.
*/
try {
} else if(
} else {
}
return tokenElement;
} catch (TransformerException te) {
"exception.", te);
}
}
/**
* Adds the key identifier to the parent element.
* @param parent the parent node that keyidentifier needs to be added.
* @exception SecurityException if there is a failure.
*/
try {
throw new IllegalArgumentException(
}
}
throw new SecurityException(
}
throw new SecurityException(
}
}
}