Java 类org.bouncycastle.asn1.esf.CrlValidatedID 实例源码

项目:dss    文件:CRLRef.java   
/**
 * The default constructor for CRLRef.
 *
 * @param cmsRef
 * @throws ParseException
 */
public CRLRef(CrlValidatedID cmsRef) {
    try {

        final CrlIdentifier crlIdentifier = cmsRef.getCrlIdentifier();
        if (crlIdentifier != null) {
            crlIssuer = crlIdentifier.getCrlIssuer();
            crlIssuedTime = crlIdentifier.getCrlIssuedTime().getDate();
            crlNumber = crlIdentifier.getCrlNumber();
        }
        final OtherHash crlHash = cmsRef.getCrlHash();

        digestAlgorithm = DigestAlgorithm.forOID(crlHash.getHashAlgorithm().getAlgorithm().getId());
        digestValue = crlHash.getHashValue();
    } catch (ParseException ex) {
        throw new DSSException(ex);
    }
}
项目:dss    文件:CAdESSignature.java   
@Override
public List<CRLRef> getCRLRefs() {

    final List<CRLRef> list = new ArrayList<CRLRef>();

    try {
        final Attribute attribute = getUnsignedAttribute(PKCSObjectIdentifiers.id_aa_ets_revocationRefs);
        if (attribute == null) {
            return list;
        }

        final ASN1Set attrValues = attribute.getAttrValues();
        if (attrValues.size() <= 0) {
            return list;
        }

        final ASN1Encodable attrValue = attrValues.getObjectAt(0);
        final ASN1Sequence completeCertificateRefs = (ASN1Sequence) attrValue;
        for (int ii = 0; ii < completeCertificateRefs.size(); ii++) {

            final ASN1Encodable completeCertificateRef = completeCertificateRefs.getObjectAt(ii);
            final CrlOcspRef otherCertId = CrlOcspRef.getInstance(completeCertificateRef);
            final CrlListID otherCertIds = otherCertId.getCrlids();
            if (otherCertIds != null) {

                for (final CrlValidatedID id : otherCertIds.getCrls()) {

                    final CRLRef crlRef = new CRLRef(id);
                    list.add(crlRef);
                }
            }
        }
    } catch (Exception e) {
        // When error in computing or in format, the algorithm just
        // continues.
        LOG.warn("When error in computing or in format the algorithm just continue...", e);
    }
    return list;
}