示例#1
0
  private CRL readDERCRL(ASN1InputStream aIn) throws IOException, CRLException {
    ASN1Sequence seq = (ASN1Sequence) aIn.readObject();

    if (seq.size() > 1 && seq.getObjectAt(0) instanceof ASN1ObjectIdentifier) {
      if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData)) {
        sCrlData =
            SignedData.getInstance(
                    ASN1Sequence.getInstance((ASN1TaggedObject) seq.getObjectAt(1), true))
                .getCRLs();

        return getCRL();
      }
    }

    return createCRL(CertificateList.getInstance(seq));
  }
示例#2
0
  private java.security.cert.Certificate readDERCertificate(ASN1InputStream dIn)
      throws IOException, CertificateParsingException {
    ASN1Sequence seq = (ASN1Sequence) dIn.readObject();

    if (seq.size() > 1 && seq.getObjectAt(0) instanceof ASN1ObjectIdentifier) {
      if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData)) {
        sData =
            SignedData.getInstance(
                    ASN1Sequence.getInstance((ASN1TaggedObject) seq.getObjectAt(1), true))
                .getCertificates();

        return getCertificate();
      }
    }

    return new X509CertificateObject(Certificate.getInstance(seq));
  }