本文整理汇总了Java中org.jasig.cas.services.RegisteredService.getPublicKey方法的典型用法代码示例。如果您正苦于以下问题:Java RegisteredService.getPublicKey方法的具体用法?Java RegisteredService.getPublicKey怎么用?Java RegisteredService.getPublicKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jasig.cas.services.RegisteredService
的用法示例。
在下文中一共展示了RegisteredService.getPublicKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRegisteredServicePublicKey
import org.jasig.cas.services.RegisteredService; //导入方法依赖的package包/类
/**
* Create registered service public key defined.
*
* @param registeredService the registered service
* @return the public key
* @throws Exception the exception, if key cant be created
*/
private PublicKey createRegisteredServicePublicKey(final RegisteredService registeredService) throws Exception {
if (registeredService.getPublicKey() == null) {
logger.debug("No public key is defined for service [{}]. No encoding will take place.",
registeredService);
return null;
}
final PublicKey publicKey = registeredService.getPublicKey().createInstance();
if (publicKey == null) {
logger.debug("No public key instance created for service [{}]. No encoding will take place.",
registeredService);
return null;
}
return publicKey;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:22,代码来源:DefaultRegisteredServiceCipherExecutor.java
示例2: mapRegisteredService
import org.jasig.cas.services.RegisteredService; //导入方法依赖的package包/类
@Override
public void mapRegisteredService(final RegisteredService svc, final ServiceData bean) {
bean.setAssignedId(Long.toString(svc.getId()));
bean.setServiceId(svc.getServiceId());
bean.setName(svc.getName());
bean.setDescription(svc.getDescription());
if (svc.getLogo() != null) {
bean.setLogoUrl(svc.getLogo().toExternalForm());
}
bean.setRequiredHandlers(svc.getRequiredHandlers());
if (svc instanceof OAuthRegisteredCallbackAuthorizeService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH_CALLBACK_AUTHZ.toString());
}
if (svc instanceof OAuthRegisteredService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH.toString());
final OAuthRegisteredService oauth = (OAuthRegisteredService) svc;
final RegisteredServiceOAuthTypeEditBean oauthBean = bean.getOauth();
oauthBean.setBypass(oauth.isBypassApprovalPrompt());
oauthBean.setClientId(oauth.getClientId());
oauthBean.setClientSecret(oauth.getClientSecret());
}
bean.setTheme(svc.getTheme());
bean.setEvalOrder(svc.getEvaluationOrder());
final LogoutType logoutType = svc.getLogoutType();
switch (logoutType) {
case BACK_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.BACK.toString());
break;
case FRONT_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.FRONT.toString());
break;
default:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.NONE.toString());
break;
}
final URL url = svc.getLogoutUrl();
if (url != null) {
bean.setLogoutUrl(url.toExternalForm());
}
final RegisteredServicePublicKey key = svc.getPublicKey();
final RegisteredServicePublicKeyEditBean pBean = bean.getPublicKey();
if (key != null) {
pBean.setAlgorithm(key.getAlgorithm());
pBean.setLocation(key.getLocation());
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:51,代码来源:DefaultRegisteredServiceMapper.java
示例3: fromRegisteredService
import org.jasig.cas.services.RegisteredService; //导入方法依赖的package包/类
/**
* From registered service to a service bean.
*
* @param svc the svc
* @return the registered service bean
*/
public static RegisteredServiceEditBean fromRegisteredService(final RegisteredService svc) {
final RegisteredServiceEditBean serviceBean = new RegisteredServiceEditBean();
final ServiceData bean = serviceBean.getServiceData();
bean.setAssignedId(svc.getId());
bean.setServiceId(svc.getServiceId());
bean.setName(svc.getName());
bean.setDescription(svc.getDescription());
if (svc.getLogo() != null) {
bean.setLogoUrl(svc.getLogo().toExternalForm());
}
bean.setRequiredHandlers(svc.getRequiredHandlers());
configureAccessStrategy(svc, bean);
if (svc instanceof OAuthRegisteredCallbackAuthorizeService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH_CALLBACK_AUTHZ.toString());
}
if (svc instanceof OAuthRegisteredService) {
bean.setType(RegisteredServiceTypeEditBean.OAUTH.toString());
final OAuthRegisteredService oauth = (OAuthRegisteredService) svc;
final RegisteredServiceOAuthTypeEditBean oauthBean = bean.getOauth();
oauthBean.setBypass(oauth.isBypassApprovalPrompt());
oauthBean.setClientId(oauth.getClientId());
oauthBean.setClientSecret(oauth.getClientSecret());
}
bean.setTheme(svc.getTheme());
bean.setEvalOrder(svc.getEvaluationOrder());
final LogoutType logoutType = svc.getLogoutType();
switch (logoutType) {
case BACK_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.BACK.toString());
break;
case FRONT_CHANNEL:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.FRONT.toString());
break;
default:
bean.setLogoutType(RegisteredServiceLogoutTypeEditBean.NONE.toString());
break;
}
final URL url = svc.getLogoutUrl();
if (url != null) {
bean.setLogoutUrl(url.toExternalForm());
}
final RegisteredServiceUsernameAttributeProvider provider = svc.getUsernameAttributeProvider();
final RegisteredServiceUsernameAttributeProviderEditBean uBean = bean.getUserAttrProvider();
configureUsernameAttributeProvider(provider, uBean);
final RegisteredServicePublicKey key = svc.getPublicKey();
final RegisteredServicePublicKeyEditBean pBean = bean.getPublicKey();
if (key != null) {
pBean.setAlgorithm(key.getAlgorithm());
pBean.setLocation(key.getLocation());
}
configureProxyPolicy(svc, bean);
configureAttributeReleasePolicy(svc, bean);
return serviceBean;
}