Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.ASN1InputStream


    private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0)
        throws IOException, CertificateEncodingException, InvalidKeyException,
            BadPaddingException, IllegalBlockSizeException
    {
        ASN1InputStream input = new ASN1InputStream(x509certificate.getTBSCertificate());
        TBSCertificateStructure certificate = TBSCertificateStructure.getInstance(input.readObject());
        input.close();

        AlgorithmIdentifier algorithmId = certificate.getSubjectPublicKeyInfo().getAlgorithm();

        IssuerAndSerialNumber serial = new IssuerAndSerialNumber(
                certificate.getIssuer(),
View Full Code Here


            // check that we don't have a DER encoded octet string
            //
            if ((params.length % 8) != 0
                    && params[0] == 0x04 && params[1] == params.length - 2)
            {
                ASN1InputStream         aIn = new ASN1InputStream(params);
                ASN1OctetString         oct = (ASN1OctetString)aIn.readObject();

                params = oct.getOctets();
            }

            this.iv = new byte[params.length];
View Full Code Here

            String format)
            throws IOException
        {
            if (isASN1FormatString(format))
            {
                ASN1InputStream         aIn = new ASN1InputStream(params);
               
                try
                {
                    ASN1OctetString         oct = (ASN1OctetString)aIn.readObject();
   
                    engineInit(oct.getOctets());
                }
                catch (Exception e)
                {
View Full Code Here

            String format)
            throws IOException
        {
            if (isASN1FormatString(format))
            {
                ASN1InputStream         aIn = new ASN1InputStream(params);
                RC2CBCParameter         p = RC2CBCParameter.getInstance(aIn.readObject());

                if (p.getRC2ParameterVersion() != null)
                {
                    parameterVersion = p.getRC2ParameterVersion().intValue();
                }
View Full Code Here

        protected void engineInit(
            byte[] params)
            throws IOException
        {
            ASN1InputStream        aIn = new ASN1InputStream(params);

            this.params = PKCS12PBEParams.getInstance(aIn.readObject());
        }
View Full Code Here

        protected void engineInit(
            byte[] params)
            throws IOException
        {
            ASN1InputStream        aIn = new ASN1InputStream(params);

            try
            {
                DHParameter dhP = new DHParameter((ASN1Sequence)aIn.readObject());

                if (dhP.getL() != null)
                {
                    currentSpec = new DHParameterSpec(dhP.getP(), dhP.getG(), dhP.getL().intValue());
                }
View Full Code Here

                List bytesList = new ArrayList();
                bytesList.add(bytes);
                try
                {
                    CertificatePair pair = CertificatePair
                        .getInstance(new ASN1InputStream(bytes)
                            .readObject());
                    bytesList.clear();
                    if (pair.getForward() != null)
                    {
                        bytesList.add(pair.getForward().getEncoded());
View Full Code Here

    private X509CertificatePair readDERCrossCertificatePair(
        InputStream in)
        throws IOException, CertificateParsingException
    {
        ASN1InputStream dIn = new ASN1InputStream(in, ProviderUtil.getReadLimit(in));
        ASN1Sequence seq = (ASN1Sequence)dIn.readObject();
        CertificatePair pair = CertificatePair.getInstance(seq);
        return new X509CertificatePair(pair);
    }
View Full Code Here

    private CRL readDERCRL(
        InputStream in)
        throws IOException, CRLException
    {
        ASN1InputStream dIn = new ASN1InputStream(in, ProviderUtil.getReadLimit(in));
        ASN1Sequence seq = (ASN1Sequence)dIn.readObject();

        if (seq.size() > 1
                && seq.getObjectAt(0) instanceof DERObjectIdentifier)
        {
            if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
View Full Code Here

        throws IllegalArgumentException
    {
        try
        {
            tbsGen.setSubjectPublicKeyInfo(
                       SubjectPublicKeyInfo.getInstance(new ASN1InputStream(key.getEncoded()).readObject()));
        }
        catch (Exception e)
        {
            throw new IllegalArgumentException("unable to process key - " + e.toString());
        }
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.ASN1InputStream

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.