1 /* 2 * JBoss, the OpenSource J2EE webOS 3 * 4 * Distributable under LGPL license. 5 * See terms of license at gnu.org. 6 */ 7 package org.jboss.security.auth.certs; 8 9 import java.security.Principal; 10 import java.security.cert.X509Certificate; 11 import org.jboss.security.CertificatePrincipal; 12 13 /** A CertificatePrincipal implementation that uses the client cert 14 * SubjectDN as the principal. 15 * 16 * @author Scott.Stark@jboss.org 17 * @version $Revision: 1.1.8.1 $ 18 */ 19 public class SubjectDNMapping 20 implements CertificatePrincipal 21 { 22 /** Returns the client cert SubjectDN as the principal. 23 * 24 * @param certs Array of client certificates, with the first one in 25 * the array being the certificate of the client itself. 26 */ 27 public Principal toPrinicipal(X509Certificate[] certs) 28 { 29 Principal subject = certs[0].getSubjectDN(); 30 return subject; 31 } 32 } 33