/**
* 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: BinarySecurityToken.java,v 1.5 2008/08/06 17:28:07 exu Exp $
*
*/
/**
* The class <code>BinarySecurityToken</code> provides interface to parse and
* create X.509 Security Token depicted by Web Service Security : X.509
* Certificate Token Profile and Liberty ID-WSF Security Mechanisms
* specifications.
* <p>The following schema fragment specifies the expected content within the BinarySecurityToken object.
* <p>
* <pre>
* <element name="BinarySecurityToken" type="wsse:BinarySecurityTokenType/>
* <complexType name="BinarySecurityTokenType">
* <simpleContent>
* <extension base="<http://schemas.xmlsoap.org/ws/2003/06/secext>EncodedString">
* <attribute name="ValueType" type="{http://www.w3.org/2001/XMLSchema}QName" />
* </extension>
* </simpleContent>
* </complexType>
* <xsd:complexType name="EncodedString">
* <xsd:simpleContent>
* <xsd:extension base="wsse:AttributedString">
* <xsd:attribute name="EncodingType" type="xsd:QName"/>
* </xsd:extension>
* </xsd:simpleContent>
* </xsd:complexType>
* <xsd:complexType name="AttributedString">
* <xsd:simpleContent>
* <xsd:extension base="xsd:string">
* <xsd:attribute ref="wsu:Id"/>
* <xsd:anyAttribute namespace="##other" processContents="lax"/>
* </xsd:extension>
* </xsd:simpleContent>
* </xsd:complexType>
* </pre>
*
* @supported.api
*/
public class BinarySecurityToken {
"libBinarySecurityToken");
/**
* Default constructor
*/
private BinarySecurityToken () {}
/**
* Constructor.
* @param value the value must be the specified <code>valueType</code>
* and encoded in the specified <code>encodingType</code>.
*
* @param valueType type of the value
* @param encodingType encoding type of the value
* @exception Exception if any input parameter is null
* @supported.api
*/
throws Exception
{
}
this.encodingType = encodingType;
}
/**
* Constructor.
* @param token Binary Security Token Element
* @exception Exception if token Element is not a valid binary
* security token
* @supported.api
*/
throws Exception {
}
// check element name
if (elementName == null) {
}
":" + elementName) ;
}
} else {
}
// check attributes
}
for (int i = 0; i < len; i++) {
// exception?? Ignore for now
if (debug.messageEnabled()) {
}
continue;
}
// check Id/EncodingType/ValueType attribute
// no namespace match done here
encodingType = (QName)
// no namespace match done here
}
}
" : " + ID);
}
if (encodingType == null) {
" : " + ENCODING_TYPE);
}
" : " + VALUE_TYPE);
}
// get X509 certificate value
try {
} catch (Exception e) {
}
}
// save the original string for toString()
}
/**
* trim prefix and get the value, e.g, for wsse:X509v3 will return X509v3
*/
return val;
}
if (pos == -1) {
return val;
return "";
} else {
}
}
/**
* Gets encoding type for the token.
*
* @return encoding type for the token.
* @supported.api
*/
return encodingType;
}
/**
* Gets value type for the token.
*
* @return value type for the token.
* @supported.api
*/
return valueType;
}
/**
* Gets id attribute for the tokens.
*
* @return id attribute for the token.
* @supported.api
*/
return id;
}
/**
* Gets value of the token.
*
* @return value of the token.
* @supported.api
*/
return value;
}
/**
* Returns a String representation of the token.
* @return A string containing the valid XML for this element
* @supported.api
*/
} else {
}
}
return xmlString;
}
/**
* The <code>X509V3</code> value type indicates that
* the value name given corresponds to a X509 Certificate.
* @supported.api
*/
/**
* The <code>KERBEROSV5TGT</code> value type indicates that
* the value name given corresponds to a Kerberos V5 TGT.
*/
/**
* The <code>KERBEROSV5ST</code> value type indicates
* that the value name given corresponds to a Kerberos V5 service ticket.
*/
/**
* The <code>PKCS7</code> value type indicates
* that the value name given corresponds to a
* PKCS7 object.
* @supported.api
*/
/**
* The <code>PKIPATH</code> value type indicates
* that the value name given corresponds to a
* PKI Path object.
* @supported.api
*/
// map from string to ValueType object
static {
}
/**
* The <code>BASE64BINARY</code> encoding type indicates that the encoding
* name given corresponds to base64 encoding of a binary value.
* @supported.api
*/
/**
* The <code>HEXBINARY</code> encoding type indicates that
* the encoding name given corresponds to Hex encoding of
* a binary value.
* @supported.api
*/
// map from string to EncodingType object
static {
}
/**
* Adds th binary security token to the header element.
* @param headerE the security header element.
* @exception Exception if there is a failure in adding to the header.
*/
}
/**
* Returns the web services version.
* @return the web services version.
*/
return wsfVersion;
}
/**
* Sets the web services version.
* @param version the web services version.
*/
this.wsfVersion = version;
if(wsfVersion != null &&
} else {
}
}
}