public class X509CertificateAuthentication extends AbstractAuthenticationToken
X509Certificate
.Constructor and Description |
---|
X509CertificateAuthentication(Object principal,
X509Certificate certificate,
Collection<? extends GrantedAuthority> authorities)
Creates a new X509CertificateAuthentication that was authenticated using the given certificate.
|
X509CertificateAuthentication(X509Certificate certificate)
Creates a new X509CertificateAuthentication that will use the given certificate.
|
Modifier and Type | Method and Description |
---|---|
void |
eraseCredentials() |
X509Certificate |
getCredentials() |
Object |
getPrincipal() |
void |
setAuthenticated(boolean authenticated) |
equals, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setDetails, toString
public X509CertificateAuthentication(X509Certificate certificate)
Authentication
, because the AbstractAuthenticationToken.isAuthenticated()
will return
false
.certificate
- The certificate to create the authentication from.public X509CertificateAuthentication(Object principal, X509Certificate certificate, Collection<? extends GrantedAuthority> authorities)
AuthenticationManager
s or AuthenticationProvider
s. The resulting
authentication is trusted (AbstractAuthenticationToken.isAuthenticated()
returns true) and has the given authorities.principal
- The authenticated principal.certificate
- The certificate that was used to authenticate the principal.authorities
- The authorities of the principal.public Object getPrincipal()
public X509Certificate getCredentials()
public void eraseCredentials()
eraseCredentials
in interface CredentialsContainer
eraseCredentials
in class AbstractAuthenticationToken
public void setAuthenticated(boolean authenticated)
setAuthenticated
in interface Authentication
setAuthenticated
in class AbstractAuthenticationToken