Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.DEREncodable


            nextObject = seq.readObject();
        }

        if (nextObject instanceof ASN1TaggedObjectParser)
        {
            DEREncodable o = nextObject;
            nextObject = null;
            return (ASN1SetParser)((ASN1TaggedObjectParser)o).getObjectParser(DERTags.SET, false);
        }

        return null;
View Full Code Here


        if (nextObject == null)
        {
            nextObject = seq.readObject();
        }

        DEREncodable o = nextObject;
        nextObject = null;

        return ASN1OctetString.getInstance(o.getDERObject());
    }
View Full Code Here

            nextObject = seq.readObject();
        }

        if (nextObject != null)
        {
            DEREncodable o = nextObject;
            nextObject = null;
            return (ASN1SetParser)((ASN1TaggedObjectParser)o).getObjectParser(DERTags.SET, false);
        }

        return null;
View Full Code Here

       
        X509Certificate sign = null;

        AlgorithmIdentifier workingAlgId = null;
        DERObjectIdentifier workingPublicKeyAlgorithm = null;
        DEREncodable workingPublicKeyParameters = null;
       
        if (trust != null)
        {
            sign = trust.getTrustedCert();
           
View Full Code Here

            _signedContent = signedContent;
            _signedData = SignedDataParser.getInstance(_contentInfo.getContent(DERTags.SEQUENCE));
            _digests = new HashMap();
           
            ASN1SetParser digAlgs = _signedData.getDigestAlgorithms();
            DEREncodable  o;
           
            while ((o = digAlgs.readObject()) != null)
            {
                AlgorithmIdentifier id = AlgorithmIdentifier.getInstance(o.getDERObject());
                try
                {
                    String        digestName = HELPER.getDigestAlgName(id.getObjectId().toString());
                    MessageDigest dig = HELPER.getDigestInstance(digestName, null);
View Full Code Here

            }
           
            try
            {
                ASN1SetParser     s = _signedData.getSignerInfos();
                DEREncodable      o;
               
                while ((o = s.readObject()) != null)
                {
                    SignerInfo info = SignerInfo.getInstance(o.getDERObject());
                    String     digestName = HELPER.getDigestAlgName(info.getDigestAlgorithm().getObjectId().getId());
                   
                    byte[] hash = (byte[])hashes.get(digestName);
                   
                    signerInfos.add(new SignerInformation(info, new DERObjectIdentifier(_signedContent.getContentType()), null, new BaseDigestCalculator(hash)));
View Full Code Here

        // load the RecipientInfoStore
        //
        ASN1SetParser s = _envelopedData.getRecipientInfos();
        List          baseInfos = new ArrayList();

        DEREncodable entry;
        while ((entry = s.readObject()) != null)
        {
            baseInfos.add(RecipientInfo.getInstance(entry.getDERObject()));
        }

        //
        // read the encrypted content info
        //
        EncryptedContentInfoParser encInfo = _envelopedData.getEncryptedContentInfo();
       
        this._encAlg = encInfo.getContentEncryptionAlgorithm();
       
        //
        // prime the recipients
        //
        List        infos = new ArrayList();
        Iterator    it = baseInfos.iterator();
        InputStream dataStream = ((ASN1OctetStringParser)encInfo.getEncryptedContent(DERTags.OCTET_STRING)).getOctetStream();
       
        while (it.hasNext())
        {
            RecipientInfo   info = (RecipientInfo)it.next();
            DEREncodable    recipInfo = info.getInfo();   

            if (recipInfo instanceof KeyTransRecipientInfo)
            {
                infos.add(new KeyTransRecipientInformation(
                            (KeyTransRecipientInfo)recipInfo, _encAlg, dataStream));
View Full Code Here

            _attrNotRead = false;
           
            if (set != null)
            {
                ASN1EncodableVector v = new ASN1EncodableVector();
                DEREncodable        o;
               
                while ((o = set.readObject()) != null)
                {
                    ASN1SequenceParser    seq = (ASN1SequenceParser)o;
                   
View Full Code Here

        }
    }

    protected AlgorithmIdentifier getAlgorithmIdentifier(String encryptionOID, AlgorithmParameters params) throws IOException
    {
        DEREncodable asn1Params;
        if (params != null)
        {
            ASN1InputStream             aIn = new ASN1InputStream(params.getEncoded("ASN.1"));

            asn1Params = aIn.readObject();
View Full Code Here

              DERObject derObjectIdentifier = ((DERObject) timeStampDerSequence.getObjectAt(0)).toASN1Object();
              DERObject derObjectValue = ((DERObject) timeStampDerSequence.getObjectAt(1)).toASN1Object();
              if ((derObjectIdentifier instanceof ASN1ObjectIdentifier) && (derObjectValue instanceof DERSet)) {
                // ASN1ObjectIdentifier asn1ObjectIdentifier = (ASN1ObjectIdentifier) derObjectIdentifier;
                DERSet set = (DERSet) derObjectValue;
                DEREncodable encodable = set.getObjectAt(0);
                TimeStampToken timeStampToken = new TimeStampToken(new CMSSignedData(encodable.getDERObject().getEncoded()));
                TimeStamp timeStamp = BouncyCastleTimeStampHelper.toTimeStamp(timeStampToken);
                signature.setTimeStamp(timeStamp);
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.DEREncodable

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.