public PathCertificateVerifier(boolean verifySelfSignedCert) { SecurityProviderUtility.installBCProvider(true); this.verifySelfSignedCertificate = verifySelfSignedCert; }
public String getUiLocalesAsString() { return Util.listAsString(uiLocales); }
public String getResponseTypesAsString() { return Util.asString(responseTypes); }
/** * All the Redirect Uris must match to return true. */ private boolean checkWhiteListRedirectUris(List<String> redirectUris) { boolean valid = true; List<String> whiteList = appConfiguration.getClientWhiteList(); URLPatternList urlPatternList = new URLPatternList(whiteList); for (String redirectUri : redirectUris) { valid &= urlPatternList.isUrlListed(redirectUri); } return valid; }
public RegisterRequest startRegistration(String appId, byte[] challenge) { return new RegisterRequest(Base64Util.base64urlencode(challenge), appId); }
public String base64Decode(String encoded) throws IllegalArgumentException, UnsupportedEncodingException { byte[] decoded = Base64Util.base64urldecode(encoded); return new String(decoded, "UTF-8"); }
public String getCustomResponseHeadersAsString() throws JSONException { return Util.mapAsString(customResponseHeaders); }
/** * By definition we expects space separated acr values as it is defined in spec. But we also try maybe some client * sent it to us as json array. So we try both. * * @return acr value list */ public List<String> acrValuesList(String acrValues) { List<String> acrs; try { acrs = Util.jsonArrayStringAsList(acrValues); } catch (JSONException ex) { acrs = Util.splittedStringAsList(acrValues, " "); } return acrs; }
public static String encodeCredentials(String username, String password) throws UnsupportedEncodingException { return Base64.encodeBase64String(Util.getBytes(username + ":" + password)); } }
public OCSPCertificateVerifier() { SecurityProviderUtility.installBCProvider(true); }
/** * None of the Redirect Uris must match to return true. */ private boolean checkBlackListRedirectUris(List<String> redirectUris) { boolean valid = true; List<String> blackList = appConfiguration.getClientBlackList(); URLPatternList urlPatternList = new URLPatternList(blackList); for (String redirectUri : redirectUris) { valid &= !urlPatternList.isUrlListed(redirectUri); } return valid; }
public String getScopesAsString() { return Util.listAsString(scopes); }
public String getPromptsAsString() { return Util.asString(prompts); }
public GenericCertificateVerifier() { SecurityProviderUtility.installBCProvider(true); }
/** * Allow post logout redirect without validation only if: * allowPostLogoutRedirectWithoutValidation = true and post_logout_redirect_uri is white listed */ private boolean allowPostLogoutRedirect(String postLogoutRedirectUri) { final Boolean allowPostLogoutRedirectWithoutValidation = appConfiguration.getAllowPostLogoutRedirectWithoutValidation(); return allowPostLogoutRedirectWithoutValidation != null && allowPostLogoutRedirectWithoutValidation && new URLPatternList(appConfiguration.getClientWhiteList()).isUrlListed(postLogoutRedirectUri); }
public String getClaimsLocalesAsString() { return Util.listAsString(claimsLocales); }
@PostConstruct public void createApplicationComponents() { SecurityProviderUtility.installBCProvider(); }
public String getAcrValuesAsString() { return Util.listAsString(acrValues); }
public CRLCertificateVerifier(final int maxCrlSize) { SecurityProviderUtility.installBCProvider(true); this.maxCrlSize = maxCrlSize; CacheLoader<String, X509CRL> checkedLoader = new CacheLoader<String, X509CRL>() { public X509CRL load(String crlURL) throws CertificateException, CRLException, NoSuchProviderException, NoSuchParserException, StreamParsingException, MalformedURLException, IOException, ExecutionException { X509CRL result = requestCRL(crlURL); Preconditions.checkNotNull(result); return result; } }; this.crlCache = CacheBuilder.newBuilder().maximumSize(10).expireAfterWrite(60, TimeUnit.MINUTES).build(checkedLoader); }
public static void main(String[] args) throws Exception { SecurityProviderUtility.installBCProvider(true); Calendar cal = Calendar.getInstance(); Date startDate = cal.getTime(); cal.add(Calendar.YEAR, 3); Date expirationDate = cal.getTime(); String dnName = "C=US,ST=TX,L=Austin,O=Gluu,CN=Gluu oxPush2 U2F v1.0.0"; generateU2fAttestationKeys(startDate, expirationDate, dnName); }