1 23 24 package org.apache.slide.authenticate; 25 26 import java.security.Principal ; 27 28 32 public final class CredentialsToken { 33 34 35 37 38 43 public CredentialsToken(String credentials) { 44 this.credentials = credentials; 45 this.trusted = false; 46 } 47 48 49 54 public CredentialsToken(Principal principal) { 55 this.credentials = principal.getName(); 56 this.trusted = true; 57 this.principal = principal; 58 } 59 60 61 63 66 private Principal principal; 67 68 71 private String credentials; 72 73 74 77 private boolean trusted; 78 79 80 82 83 88 public boolean isTrusted() { 89 return trusted; 90 } 91 92 93 98 public String getPrivateCredentials() { 99 return credentials; 101 } 102 103 108 public Principal getPrincipal() { 109 return principal; 110 } 111 112 117 public String getPublicCredentials() { 118 return credentials; 119 } 120 121 122 } 123 | Popular Tags |