java.security.cert.X509CRLEntry#getRevocationDate()源码实例Demo

下面列出了java.security.cert.X509CRLEntry#getRevocationDate() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: portecle   文件: RevokedCertsTableModel.java
/**
 * Load the RevokedCertsTableModel with an array of X.509 CRL entries.
 *
 * @param revokedCerts The X.509 CRL entries
 */
public void load(X509CRLEntry[] revokedCerts)
{
	// Create one table row for each revoked certificate
	m_data = new Object[revokedCerts.length][getColumnCount()];

	// Iterate through the sorted revoked certificates populating the table model
	int iCnt = 0;
	for (X509CRLEntry x509CrlEntry : revokedCerts)
	{
		int col = 0;

		// Populate the serial number column
		m_data[iCnt][col++] = x509CrlEntry.getSerialNumber();

		// Populate the modified date column
		m_data[iCnt][col++] = x509CrlEntry.getRevocationDate();

		iCnt++;
	}

	fireTableDataChanged();
}
 
public RevokedCertificateException(final X509CRLEntry entry) {
    this.revocationDate = entry.getRevocationDate();
    this.serial = entry.getSerialNumber();
    if (entry.hasExtensions()) {
        try {
            final int code = Integer.parseInt(
                    new String(entry.getExtensionValue(CRL_REASON_OID), "ASCII"));
            if (code < Reason.values().length) {
                this.reason = Reason.fromCode(code);
            }
        } catch (final Exception e) {
            logger.trace("An exception occurred when resolving extension value: {}", e.getMessage());
        }
    }
}
 
源代码3 项目: dss   文件: CRLToken.java
/**
 * @param certificateToken
 *            the {@code CertificateToken} which is managed by this CRL.
 */
private void setRevocationStatus(final CertificateToken certificateToken) {
	final X500Principal issuerToken = certificateToken.getIssuerX500Principal();
	CertificateToken crlSigner = crlValidity.getIssuerToken();
	X500Principal crlSignerSubject = null;
	if (crlSigner != null) {
		crlSignerSubject = crlSigner.getSubject().getPrincipal();
	}

	if (!DSSASN1Utils.x500PrincipalAreEquals(issuerToken, crlSignerSubject)) {
		if (!crlValidity.isSignatureIntact()) {
			throw new DSSException(crlValidity.getSignatureInvalidityReason());
		}
		throw new DSSException("The CRLToken is not signed by the same issuer as the CertificateToken to be verified!");
	}

	final BigInteger serialNumber = certificateToken.getSerialNumber();
	X509CRLEntry crlEntry = CRLUtils.getRevocationInfo(crlValidity, serialNumber);

	if (crlEntry != null) {
		status = CertificateStatus.REVOKED;
		revocationDate = crlEntry.getRevocationDate();
		CRLReason revocationReason = crlEntry.getRevocationReason();
		if (revocationReason != null) {
			reason = RevocationReason.fromInt(revocationReason.ordinal());
		}
	} else {
		status = CertificateStatus.GOOD;
	}
}
 
/**
 * Instantiates a new revoked certificate exception.
 *
 * @param entry the entry
 */
public RevokedCertificateException(final X509CRLEntry entry) {
    this(entry.getRevocationDate(), entry.getSerialNumber(), getReasonFromX509Entry(entry));
}