Clover coverage report - Acegi Security System for Spring - 1.0.0-RC1
Coverage timestamp: Mon Dec 5 2005 09:05:15 EST
file stats: LOC: 81   Methods: 9
NCLOC: 40   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
X509AuthenticationToken.java - 81.8% 77.8% 80%
coverage coverage
 1    /* Copyright 2004, 2005 Acegi Technology Pty Limited
 2    *
 3    * Licensed under the Apache License, Version 2.0 (the "License");
 4    * you may not use this file except in compliance with the License.
 5    * You may obtain a copy of the License at
 6    *
 7    * http://www.apache.org/licenses/LICENSE-2.0
 8    *
 9    * Unless required by applicable law or agreed to in writing, software
 10    * distributed under the License is distributed on an "AS IS" BASIS,
 11    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    * See the License for the specific language governing permissions and
 13    * limitations under the License.
 14    */
 15   
 16    package org.acegisecurity.providers.x509;
 17   
 18    import org.acegisecurity.providers.AbstractAuthenticationToken;
 19    import org.acegisecurity.GrantedAuthority;
 20   
 21    import java.security.cert.X509Certificate;
 22   
 23    /**
 24    * <code>Authentication</code> implementation for X.509 client-certificate authentication.
 25    *
 26    * @author Luke Taylor
 27    * @version $Id: X509AuthenticationToken.java,v 1.5 2005/11/17 00:56:09 benalex Exp $
 28    */
 29    public class X509AuthenticationToken extends AbstractAuthenticationToken {
 30    //~ Instance fields ========================================================
 31   
 32    private X509Certificate credentials;
 33    private Object principal;
 34    private GrantedAuthority[] authorities;
 35    private boolean authenticated = false;
 36    private Object details = null;
 37   
 38    //~ Constructors ===========================================================
 39   
 40    /** Used for an authentication request */
 41  7 public X509AuthenticationToken(X509Certificate credentials) {
 42  7 this.credentials = credentials;
 43    }
 44   
 45  1 public X509AuthenticationToken(Object principal, X509Certificate credentials, GrantedAuthority[] authorities) {
 46  1 this.credentials = credentials;
 47  1 this.principal = principal;
 48  1 this.authorities = authorities;
 49    }
 50   
 51    //~ Methods ================================================================
 52   
 53  0 public Object getDetails() {
 54  0 return details;
 55    }
 56   
 57  3 public void setDetails(Object details) {
 58  3 this.details = details;
 59    }
 60   
 61   
 62  1 public void setAuthenticated(boolean isAuthenticated) {
 63  1 this.authenticated = isAuthenticated;
 64    }
 65   
 66  2 public boolean isAuthenticated() {
 67  2 return authenticated;
 68    }
 69   
 70  1 public GrantedAuthority[] getAuthorities() {
 71  1 return authorities;
 72    }
 73   
 74  5 public Object getCredentials() {
 75  5 return credentials;
 76    }
 77   
 78  0 public Object getPrincipal() {
 79  0 return principal;
 80    }
 81    }