本文整理汇总了Java中java.security.cert.X509CRL.toString方法的典型用法代码示例。如果您正苦于以下问题:Java X509CRL.toString方法的具体用法?Java X509CRL.toString怎么用?Java X509CRL.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.cert.X509CRL
的用法示例。
在下文中一共展示了X509CRL.toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import java.security.cert.X509CRL; //导入方法依赖的package包/类
/**
* {@inheritDoc}
* The CRL next update time is compared against the current time with the threshold
* applied and rejected if and only if the next update time is in the past.
*
* @param crl CRL instance to evaluate.
*
* @throws GeneralSecurityException On expired CRL data. Check the exception type for exact details
*
* @see org.jasig.cas.adaptors.x509.authentication.handler.support.RevocationPolicy#apply(java.lang.Object)
*/
@Override
public void apply(final X509CRL crl) throws GeneralSecurityException {
final Calendar cutoff = Calendar.getInstance();
if (CertUtils.isExpired(crl, cutoff.getTime())) {
cutoff.add(Calendar.SECOND, -this.threshold);
if (CertUtils.isExpired(crl, cutoff.getTime())) {
throw new ExpiredCRLException(crl.toString(), cutoff.getTime(), this.threshold);
}
logger.info(String.format("CRL expired on %s but is within threshold period, %s seconds.",
crl.getNextUpdate(), this.threshold));
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:24,代码来源:ThresholdExpiredCRLRevocationPolicy.java
示例2: apply
import java.security.cert.X509CRL; //导入方法依赖的package包/类
/**
* {@inheritDoc}
* The CRL next update time is compared against the current time with the threshold
* applied and rejected if and only if the next update time is in the past.
*
* @param crl CRL instance to evaluate.
*
* @throws ExpiredCRLException On expired CRL data. Check the exception type for exact details
*
* @see RevocationPolicy#apply(java.lang.Object)
*/
@Override
public void apply(final X509CRL crl) throws ExpiredCRLException {
final ZonedDateTime cutoff = ZonedDateTime.now(ZoneOffset.UTC);
if (CertUtils.isExpired(crl, cutoff)) {
if (CertUtils.isExpired(crl, cutoff.minusSeconds(this.threshold))) {
throw new ExpiredCRLException(crl.toString(), cutoff, this.threshold);
}
LOGGER.info(String.format("CRL expired on %s but is within threshold period, %s seconds.",
crl.getNextUpdate(), this.threshold));
}
}