001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: X509TokenSpec.java,v 1.3 2008/08/27 19:05:53 mrudul_uchil Exp $
026 *
027 */
028
029package com.sun.identity.wss.security;
030
031
032/**
033 * This class defines the specification for generating the X509 security tokens.
034 * It implements <code>SecurityTokenSpec</code> interface.
035 * 
036 * @supported.all.api
037 */ 
038public class X509TokenSpec implements SecurityTokenSpec {
039
040    public static final String DIRECT_REFERENCE = "DirectReference";
041
042    public static final String KEY_IDENTIFIER = "KeyIdentifier";
043
044    public static final String ISSUER_SERIAL = "IssuerSerial";
045
046    private String[] certAlias = null;
047    String valueType = null;
048    String encodingType = null;
049    String referenceType = null;
050
051    /**
052     * Constructor that defines this specfication.
053     *
054     * @param certAlias the array of certificate aliases that can be used
055     *        to create the X509 token specification. For example the PKI
056     *        PathSecurity token would need ordered list of certificates.
057     *
058     * @param valueType the token value type. This is to indicate the 
059     *        value of the certificate.
060     *
061     * @param encodingType the token encoding type of the certficates that
062     *        are attached in the security header.
063     */
064    public X509TokenSpec(String[] certAlias, 
065          String valueType, String encodingType) {
066
067        this.certAlias = certAlias;
068        this.valueType = valueType;
069        this.encodingType = encodingType;
070    }
071
072    /**
073     * Returns the array of certificate aliases defined in this spec.
074     *
075     * @return String[] the array of subject certificate aliases.
076     */ 
077    public String[] getSubjectCertAlias() {
078        return certAlias;
079    }
080
081    /**
082     * Returns the X509 token type.
083     *
084     * @return the X509 token type. 
085     */
086    public String getValueType() {
087        return valueType;
088    }
089
090    /**
091     * Returns the encoding type.
092     *
093     *@return the encoding type of the certificates used.
094     */
095    public String getEncodingType() {
096        return encodingType;
097    }
098
099    /**
100     * Returns the token reference type.
101     *
102     * @return the reference type for the x509 token.
103     */
104    public String getReferenceType() {
105        return referenceType;
106    }
107
108    /**
109     * Sets the token reference type.
110     */
111    public void setReferenceType(String referenceType) {
112        this.referenceType = referenceType;
113    }
114
115}