Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.BERInputStream.readObject()


        byte[]  encoding)
        throws IOException
    {
        ByteArrayInputStream    bIn = new ByteArrayInputStream(encoding);
        ASN1InputStream         aIn = new ASN1InputStream(bIn);
        ASN1Sequence            s = (ASN1Sequence)aIn.readObject();

        BigInteger[]            sig = new BigInteger[2];

        sig[0] = ((DERInteger)s.getObjectAt(0)).getValue();
        sig[1] = ((DERInteger)s.getObjectAt(1)).getValue();
View Full Code Here


        }

        AlgorithmParameters parameters = apg.generateParameters();

        ASN1InputStream input = new ASN1InputStream(parameters.getEncoded("ASN.1"));
        ASN1Primitive object = input.readObject();
        input.close();

        keygen.init(128);
        SecretKey secretkey = keygen.generateKey();
View Full Code Here

    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(
View Full Code Here

            //
            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

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

            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

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

            this.params = PKCS12PBEParams.getInstance(aIn.readObject());
        }

        protected void engineInit(
            byte[] params,
            String format)
View Full Code Here

        {
            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

    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);
    }

    public void engineInit(InputStream in)
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

TOP
Copyright © 2018 www.massapi.com. 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.