Java 类java.security.cert.X509CRLEntry 实例源码

项目:ipack    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:cas4.0.x-server-wechat    文件:AbstractCRLRevocationChecker.java   
/** {@inheritDoc} */
@Override
public void check(final X509Certificate cert) throws GeneralSecurityException {
    if (cert == null) {
        throw new IllegalArgumentException("Certificate cannot be null.");
    }
    logger.debug("Evaluating certificate revocation status for {}", CertUtils.toString(cert));
    final X509CRL crl = getCRL(cert);
    if (crl == null) {
        logger.warn("CRL data is not available for {}", CertUtils.toString(cert));
        this.unavailableCRLPolicy.apply(null);
        return;
    }
    if (CertUtils.isExpired(crl)) {
        logger.warn("CRL data expired on ", crl.getNextUpdate());
        this.expiredCRLPolicy.apply(crl);
    }
    final X509CRLEntry entry = crl.getRevokedCertificate(cert);
    if (entry != null) {
        throw new RevokedCertificateException(entry);
    }
}
项目:OpenJSharp    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:jdk8u-jdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:openjdk-jdk10    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:openjdk9    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:conscrypt    文件:OpenSSLX509CRL.java   
@Override
public X509CRLEntry getRevokedCertificate(X509Certificate certificate) {
    if (certificate instanceof OpenSSLX509Certificate) {
        OpenSSLX509Certificate osslCert = (OpenSSLX509Certificate) certificate;
        final long x509RevokedRef = NativeCrypto.X509_CRL_get0_by_cert(mContext,
                osslCert.getContext());

        if (x509RevokedRef == 0) {
            return null;
        }

        return new OpenSSLX509CRLEntry(NativeCrypto.X509_REVOKED_dup(x509RevokedRef));
    }

    return getRevokedCertificate(certificate.getSerialNumber());
}
项目: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();
}
项目:jdk8u_jdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:Aki-SSL    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:keystore-explorer    文件:DViewCrl.java   
private void crlEntrySelection() {
    int row = jtRevokedCerts.getSelectedRow();

    if (row != -1) {
        BigInteger serialNumber = (BigInteger) jtRevokedCerts.getValueAt(row, 0);

        Set<?> revokedCertsSet = crl.getRevokedCertificates();

        X509CRLEntry x509CrlEntry = null;

        for (Iterator<?> itr = revokedCertsSet.iterator(); itr.hasNext();) {
            X509CRLEntry entry = (X509CRLEntry) itr.next();
            if (serialNumber.equals(entry.getSerialNumber())) {
                x509CrlEntry = entry;
                break;
            }
        }

        if (x509CrlEntry.hasExtensions()) {
            jbCrlEntryExtensions.setEnabled(true);
            return;
        }
    }

    jbCrlEntryExtensions.setEnabled(false);
}
项目:keystore-explorer    文件:DViewCrl.java   
private void displayCrlEntryExtensions() {
    int row = jtRevokedCerts.getSelectedRow();

    if (row != -1) {
        BigInteger serialNumber = (BigInteger) jtRevokedCerts.getValueAt(row, 0);

        Set<?> revokedCertsSet = crl.getRevokedCertificates();

        X509CRLEntry x509CrlEntry = null;

        for (Iterator<?> itr = revokedCertsSet.iterator(); itr.hasNext();) {
            X509CRLEntry entry = (X509CRLEntry) itr.next();
            if (serialNumber.equals(entry.getSerialNumber())) {
                x509CrlEntry = entry;
                break;
            }
        }

        if (x509CrlEntry.hasExtensions()) {
            DViewExtensions dViewExtensions = new DViewExtensions(this,
                    res.getString("DViewCrl.EntryExtensions.Title"), x509CrlEntry);
            dViewExtensions.setLocationRelativeTo(this);
            dViewExtensions.setVisible(true);
        }
    }
}
项目:android-vts    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see java.security.cert.X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retrieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:cas-4.0.1    文件:AbstractCRLRevocationChecker.java   
/** {@inheritDoc} */
@Override
public void check(final X509Certificate cert) throws GeneralSecurityException {
    if (cert == null) {
        throw new IllegalArgumentException("Certificate cannot be null.");
    }
    logger.debug("Evaluating certificate revocation status for {}", CertUtils.toString(cert));
    final X509CRL crl = getCRL(cert);
    if (crl == null) {
        logger.warn("CRL data is not available for {}", CertUtils.toString(cert));
        this.unavailableCRLPolicy.apply(null);
        return;
    }
    if (CertUtils.isExpired(crl)) {
        logger.warn("CRL data expired on ", crl.getNextUpdate());
        this.expiredCRLPolicy.apply(crl);
    }
    final X509CRLEntry entry = crl.getRevokedCertificate(cert);
    if (entry != null) {
        throw new RevokedCertificateException(entry);
    }
}
项目:dss    文件:CRLToken.java   
/**
 * @param certificateToken
 *            the {@code CertificateToken} which is managed by this CRL.
 */
private void setRevocationStatus(final CertificateToken certificateToken) {
    final CertificateToken issuerToken = certificateToken.getIssuerToken();
    if (!issuerToken.equals(crlValidity.getIssuerToken())) {
        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);

    status = null == crlEntry;
    if (!status) {
        revocationDate = crlEntry.getRevocationDate();
        CRLReason revocationReason = crlEntry.getRevocationReason();
        if (revocationReason != null) {
            reason = CRLReasonEnum.fromInt(revocationReason.ordinal()).name();
        }
    }
}
项目:infobip-open-jdk-8    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:p00    文件:AbstractCRLRevocationChecker.java   
/** {@inheritDoc} */
@Override
public void check(final X509Certificate cert) throws GeneralSecurityException {
    if (cert == null) {
        throw new IllegalArgumentException("Certificate cannot be null.");
    }
    logger.debug("Evaluating certificate revocation status for {}", CertUtils.toString(cert));
    final X509CRL crl = getCRL(cert);
    if (crl == null) {
        logger.warn("CRL data is not available for {}", CertUtils.toString(cert));
        this.unavailableCRLPolicy.apply(null);
        return;
    }
    if (CertUtils.isExpired(crl)) {
        logger.warn("CRL data expired on ", crl.getNextUpdate());
        this.expiredCRLPolicy.apply(crl);
    }
    final X509CRLEntry entry = crl.getRevokedCertificate(cert);
    if (entry != null) {
        throw new RevokedCertificateException(entry);
    }
}
项目:cas-server-4.0.1    文件:AbstractCRLRevocationChecker.java   
/** {@inheritDoc} */
@Override
public void check(final X509Certificate cert) throws GeneralSecurityException {
    if (cert == null) {
        throw new IllegalArgumentException("Certificate cannot be null.");
    }
    logger.debug("Evaluating certificate revocation status for {}", CertUtils.toString(cert));
    final X509CRL crl = getCRL(cert);
    if (crl == null) {
        logger.warn("CRL data is not available for {}", CertUtils.toString(cert));
        this.unavailableCRLPolicy.apply(null);
        return;
    }
    if (CertUtils.isExpired(crl)) {
        logger.warn("CRL data expired on ", crl.getNextUpdate());
        this.expiredCRLPolicy.apply(crl);
    }
    final X509CRLEntry entry = crl.getRevokedCertificate(cert);
    if (entry != null) {
        throw new RevokedCertificateException(entry);
    }
}
项目:In-the-Box-Fork    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see java.security.cert.X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retrieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:jdk7-jdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:AcademicTorrents-Downloader    文件:X509CRLObject.java   
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
{
    TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

    if ( certs != null )
    {
        for ( int i = 0; i < certs.length; i++ )
        {
            if ( certs[i].getUserCertificate().getValue().equals(serialNumber) ) {
                return new X509CRLEntryObject(certs[i]);
            }
        }
    }

    return null;
}
项目:AcademicTorrents-Downloader    文件:X509CRLObject.java   
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
{
    TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

    if ( certs != null )
    {
        for ( int i = 0; i < certs.length; i++ )
        {
            if ( certs[i].getUserCertificate().getValue().equals(serialNumber) ) {
                return new X509CRLEntryObject(certs[i]);
            }
        }
    }

    return null;
}
项目:openjdk-source-code-learn    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:RipplePower    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:OLD-OpenJDK8    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:cn1    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see java.security.cert.X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retrieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:CryptMeme    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:CryptMeme    文件:CRL5Test.java   
public void indirectCRLTest()
    throws Exception
{
    CertificateFactory cf = CertificateFactory.getInstance("X.509", "BC");
    ByteArrayInputStream in = new ByteArrayInputStream(inDirectCrl);
    X509CRL crl = (X509CRL) cf.generateCRL(in);
    Set set = crl.getRevokedCertificates();
    Iterator it = set.iterator();
    while (it.hasNext())
    {
        if (((X509CRLEntry)it.next()).getCertificateIssuer() == null)
        {
            fail("certificate issuer CRL entry extension is null");
        }
    }
}
项目:CryptMeme    文件:CRL5Test.java   
public void directCRLTest()
    throws Exception
{
    CertificateFactory cf = CertificateFactory.getInstance("X.509", "BC");
    ByteArrayInputStream in = new ByteArrayInputStream(directCRL);
    X509CRL crl = (X509CRL) cf.generateCRL(in);
    Set set = crl.getRevokedCertificates();
    Iterator it = set.iterator();
    while (it.hasNext())
    {
        if (((X509CRLEntry)it.next()).getCertificateIssuer() != null)
        {
            fail("certificate issuer CRL entry extension is not null");
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:nextop-client    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retrieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:ripple-lib-java    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:freeVM    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see java.security.cert.X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retirieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:freeVM    文件:X509CRLImpl.java   
/**
 * Method searches for CRL entry with specified serial number.
 * The method will search only certificate issued by CRL's issuer.
 * @see java.security.cert.X509CRL#getRevokedCertificate(BigInteger)
 * method documentation for more info
 */
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    if (!entriesRetrieved) {
        retrieveEntries();
    }
    if (entries == null) {
        return null;
    }
    for (int i=0; i<nonIndirectEntriesSize; i++) {
        X509CRLEntry entry = (X509CRLEntry) entries.get(i);
        if (serialNumber.equals(entry.getSerialNumber())) {
            return entry;
        }
    }
    return null;
}
项目:openjdk-icedtea7    文件:X509CRLEntryImpl.java   
/**
 * This static method is the default implementation of the
 * getRevocationReason method in X509CRLEntry.
 */
public static CRLReason getRevocationReason(X509CRLEntry crlEntry) {
    try {
        byte[] ext = crlEntry.getExtensionValue("2.5.29.21");
        if (ext == null) {
            return null;
        }
        DerValue val = new DerValue(ext);
        byte[] data = val.getOctetString();

        CRLReasonCodeExtension rcExt =
            new CRLReasonCodeExtension(Boolean.FALSE, data);
        return rcExt.getReasonCode();
    } catch (IOException ioe) {
        return null;
    }
}
项目:irma_future_id    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:irma_future_id    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}
项目:irma_future_id    文件:X509V2CRLGenerator.java   
/**
 * Add the CRLEntry objects contained in a previous CRL.
 * 
 * @param other the X509CRL to source the other entries from. 
 */
public void addCRL(X509CRL other)
    throws CRLException
{
    Set revocations = other.getRevokedCertificates();

    if (revocations != null)
    {
        Iterator it = revocations.iterator();
        while (it.hasNext())
        {
            X509CRLEntry entry = (X509CRLEntry)it.next();

            ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

            try
            {
                tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
            }
            catch (IOException e)
            {
                throw new CRLException("exception processing encoding of CRL: " + e.toString());
            }
        }
    }
}