Package org.bouncycastle.asn1.x509

Examples of org.bouncycastle.asn1.x509.CRLDistPoint


            throws AnnotatedException
        {
            Set set = new HashSet();
            if (paramsPKIX.isUseDeltasEnabled())
            {
                CRLDistPoint freshestCRL = null;
                try
                {
                    freshestCRL = CRLDistPoint
                        .getInstance(CertPathValidatorUtilities.getExtensionValue(
                            cert, FRESHEST_CRL));
View Full Code Here


            X509Certificate cert, Date validDate, X509Certificate sign,
            PublicKey workingPublicKey, List certPathCerts)
            throws AnnotatedException
        {
            AnnotatedException lastException = null;
            CRLDistPoint crldp = null;
            try
            {
                crldp = CRLDistPoint.getInstance(CertPathValidatorUtilities
                    .getExtensionValue(cert,
                        CRL_DISTRIBUTION_POINTS));
            }
            catch (Exception e)
            {
                throw new AnnotatedException(
                    "CRL distribution point extension could not be read.", e);
            }
            try
            {
                CertPathValidatorUtilities
                    .addAdditionalStoresFromCRLDistributionPoint(crldp, paramsPKIX);
            }
            catch (AnnotatedException e)
            {
                throw new AnnotatedException(
                    "No additional CRL locations could be decoded from CRL distribution point extension.",
                    e);
            }
            CertStatus certStatus = new CertStatus();
            ReasonsMask reasonsMask = new ReasonsMask();

            boolean validCrlFound = false;
            // for each distribution point
            if (crldp != null)
            {
                DistributionPoint dps[] = null;
                try
                {
                    dps = crldp.getDistributionPoints();
                }
                catch (Exception e)
                {
                    throw new AnnotatedException(
                        "Distribution points could not be read.", e);
View Full Code Here

    DERObject crldistribuitionPointsObject = crldistribuitionPointsBytesStream.readObject();
    DEROctetString crldistribuitionPointsString = (DEROctetString) crldistribuitionPointsObject;

    crldistribuitionPointsBytesStream = new ASN1InputStream(new ByteArrayInputStream(crldistribuitionPointsString.getOctets()));
    crldistribuitionPointsObject = crldistribuitionPointsBytesStream.readObject();
    CRLDistPoint distPoint = CRLDistPoint.getInstance(crldistribuitionPointsObject);

    List<String> urls = new ArrayList<String>();

    for (DistributionPoint distribuitionPoint : distPoint.getDistributionPoints()) {
      DistributionPointName distribuitionPointName = distribuitionPoint.getDistributionPoint();
      if ((distribuitionPointName != null) && (distribuitionPointName.getType() == DistributionPointName.FULL_NAME)) {
        GeneralName[] genNames = GeneralNames.getInstance(distribuitionPointName.getName()).getNames();
        for (int i = 0; i < genNames.length; i++) {
          if (genNames[i].getTagNo() == GeneralName.uniformResourceIdentifier) {
View Full Code Here

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
View Full Code Here

    {
        byte[]  hash = new byte[digest.getDigestSize()];

        digest.doFinal(hash, 0);

        DigestInfo  digInfo;
        byte[]      sig;

        try
        {
            sig = cipher.processBlock(sigBytes, 0, sigBytes.length);
            digInfo = derDecode(sig);
        }
        catch (Exception e)
        {
            return false;
        }

        if (!digInfo.getAlgorithmId().equals(algId))
        {
            return false;
        }

        byte[]  sigHash = digInfo.getDigest();

        if (hash.length != sigHash.length)
        {
            return false;
        }
View Full Code Here

        byte[]  hash)
        throws IOException
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        DEROutputStream         dOut = new DEROutputStream(bOut);
        DigestInfo              dInfo = new DigestInfo(algId, hash);

        dOut.writeObject(dInfo);

        return bOut.toByteArray();
    }
View Full Code Here

        throws IOException
    {
        ByteArrayInputStream    bIn = new ByteArrayInputStream(encoding);
        DERInputStream          dIn = new DERInputStream(bIn);

        return new DigestInfo((ASN1Sequence)dIn.readObject());
    }
View Full Code Here

    JCERSAPublicKey(
        SubjectPublicKeyInfo    info)
    {
        try
        {
            RSAPublicKeyStructure   pubKey = new RSAPublicKeyStructure((ASN1Sequence)info.getPublicKey());

            this.modulus = pubKey.getModulus();
            this.publicExponent = pubKey.getPublicExponent();
    }
        catch (IOException e)
        {
      throw new IllegalArgumentException("invalid info structure in RSA public key");
        }
View Full Code Here

    public byte[] getEncoded()
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        DEROutputStream         dOut = new DEROutputStream(bOut);
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, new DERNull()), new RSAPublicKeyStructure(getModulus(), getPublicExponent()).getDERObject());

        try
        {
            dOut.writeObject(info);
            dOut.close();
View Full Code Here

            params = new X962Parameters(ecP);
        }

        ASN1OctetString    p = (ASN1OctetString)(new X9ECPoint(this.getQ()).getDERObject());

        SubjectPublicKeyInfo info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params.getDERObject()), p.getOctets());

        try
        {
            dOut.writeObject(info);
            dOut.close();
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.x509.CRLDistPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.