SecurityTokenReference.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: SecurityTokenReference.java,v 1.4 2008/06/25 05:50:09 qcheng Exp $
*
*/
/**
* This class represents the <code>SecurityTokenReference</code> for
* referencing the web services tokens that are used for message level
* security in the SOAP header.
*/
public class SecurityTokenReference {
private KeyIdentifier keyIdentifier;
private String referenceType;
// default constructor
public SecurityTokenReference() {
}
/**
* Constructor
* @param element the security token reference.
* @exception SecurityException if the token parsing fails.
*/
throw new IllegalArgumentException(
}
element.getLocalName())) ||
throw new SecurityException(
}
throw new SecurityException(
}
continue;
}
try {
} catch (XMLSecurityException xe) {
throw new SecurityException(
}
}
}
}
/**
* Returns the reference type
*
* @return the reference type.
*/
public String getReferenceType() {
return referenceType;
}
/**
* Sets the reference type.
*
* @param referenceType the reference type.
*/
this.referenceType = referenceType;
}
/**
* Returns the <code>Reference</code>.
*
* @return the <code>Reference</code>.
*/
public Reference getReference() {
return reference;
}
/**
* Sets the <code>Reference</code>
*
* @param reference the reference element.
*/
}
/**
* Sets the key identifier.
*
* @param keyIdentifier the key identifier.
*/
this.keyIdentifier = keyIdentifier;
}
/**
* Returns the key identifier
*
* @return the key identifier
*/
public KeyIdentifier getKeyIdentifier() {
return keyIdentifier;
}
/**
* Returns the security token reference id.
* @return the security token reference id.
*/
return id;
}
/**
* Sets the security token reference id.
* @param id the security token reference id.
*/
}
/**
* Returns the X509data.
*
* @return the X509Data.
*/
public X509Data getX509IssuerSerial() {
return x509Data;
}
/**
* Sets the X509Data.
*
* @param x509Data the X509 data.
*/
}
/**
* Returns the referenced security token via the Reference URI.
*
* @return the security token that is referenece via the reference URI.
*/
return null;
}
try {
} else if(
} else {
}
return tokenElement;
} catch (TransformerException te) {
"exception.", te);
}
}
/**
* Adds the securitytoken reference to the parent element.
* @param parent the parent node that securitytoken reference
* needs to be added.
* @exception SecurityException if there is a failure.
*/
try {
throw new IllegalArgumentException(
}
}
if(keyIdentifier != null) {
}
"to parent", ex);
throw new SecurityException(
}
}
}