/**
 * EasyBeans
 * Copyright (C) 2008 Bull S.A.S.
 * Contact: easybeans@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.security.realm.web.catalina55;

import java.util.List;

import org.apache.catalina.Realm;
import org.apache.catalina.realm.GenericPrincipal;

/**
 * Defines a JOnAs/Tomcat Principal that can include a digital signature for the security.
 * @author Florent BENOIT
 *
 */
public class JOnASGenericPrincipal extends GenericPrincipal {

    /**
     * Signature.
     */
    private byte[] signature = null;

    /**
     * Defines a new Principal with the given realm and attributes.
     * @param realm the given realm instance
     * @param name the name of the principal
     * @param password the password of the principal
     * @param roles the roles of the principal
     */
    public JOnASGenericPrincipal(final Realm realm, final String name, final String password, final List roles) {
        super(realm, name, password, roles);
    }

    /**
     * @return the signature of this principal.
     */
    public byte[] getSignature() {
        return signature;
    }

    /**
     * Sets the given signature on this principal.
     * @param signature the given signature
     */
    public void setSignature(final byte[] signature) {
        this.signature = signature;
    }


}
