Examples of AuthenticatedSafe


Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(((ASN1OctetString)info.getContent()).getOctets());

            AuthenticatedSafe authSafe = AuthenticatedSafe.getInstance(bIn.readObject());
            ContentInfo[] c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

            {
                new ContentInfo(data, keyString),
                new ContentInfo(encryptedData, cInfo.toASN1Primitive())
            };

        AuthenticatedSafe auth = new AuthenticatedSafe(info);

        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        DEROutputStream asn1Out;
        if (useDEREncoding)
        {
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(((ASN1OctetString)info.getContent()).getOctets());

            AuthenticatedSafe   authSafe = new AuthenticatedSafe((ASN1Sequence)bIn.readObject());
            ContentInfo[]       c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        {
            new ContentInfo(data, keyString),
            new ContentInfo(encryptedData, cInfo.getDERObject())
        };

        AuthenticatedSafe   auth = new AuthenticatedSafe(info);

        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        BEROutputStream         berOut = new BEROutputStream(bOut);

        berOut.writeObject(auth);
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

            byte[]              salt = mData.getSalt();
            int                 itCount = mData.getIterationCount().intValue();

            aIn = new ASN1InputStream(new ByteArrayInputStream(((ASN1OctetString)info.getContent()).getOctets()));

            AuthenticatedSafe   authSafe = new AuthenticatedSafe((ASN1Sequence)aIn.readObject());
            ContentInfo[]       c = authSafe.getContentInfo();

            //
            // private key section
            //
            if (!c[0].getContentType().equals(PKCSObjectIdentifiers.data))
            {
                return new SimpleTestResult(false, getName() + ": failed comparison data test");
            }
           
            aIn = new ASN1InputStream(new ByteArrayInputStream(((ASN1OctetString)c[0].getContent()).getOctets()));
            ASN1Sequence    seq = (ASN1Sequence)aIn.readObject();
           
            SafeBag b = new SafeBag((ASN1Sequence)seq.getObjectAt(0));
            if (!b.getBagId().equals(PKCSObjectIdentifiers.pkcs8ShroudedKeyBag))
            {
                return new SimpleTestResult(false, getName() + ": failed comparison shroudedKeyBag test");
            }
           
            EncryptedPrivateKeyInfo encInfo = EncryptedPrivateKeyInfo.getInstance((ASN1Sequence)b.getBagValue());
           
            encInfo = new EncryptedPrivateKeyInfo(encInfo.getEncryptionAlgorithm(), encInfo.getEncryptedData());
           
            b = new SafeBag(PKCSObjectIdentifiers.pkcs8ShroudedKeyBag, encInfo.toASN1Object(), b.getBagAttributes());
           
            ByteArrayOutputStream abOut = new ByteArrayOutputStream();
            ASN1OutputStream      berOut = new ASN1OutputStream(abOut);
           
            berOut.writeObject(new DERSequence(b));
           
            c[0] = new ContentInfo(PKCSObjectIdentifiers.data, new BERConstructedOctetString(abOut.toByteArray()));
           
            //
            // certificates
            //
            if (!c[1].getContentType().equals(PKCSObjectIdentifiers.encryptedData))
            {
                return new SimpleTestResult(false, getName() + ": failed comparison encryptedData test");
            }
           
            EncryptedData   eData = EncryptedData.getInstance(c[1].getContent());
           
            c[1] = new ContentInfo(PKCSObjectIdentifiers.encryptedData, eData);
           
            //
            // create an octet stream represent the BER encoding of authSafe
            //
            authSafe = new AuthenticatedSafe(c);
           
            abOut = new ByteArrayOutputStream();
            berOut = new ASN1OutputStream(abOut);

            berOut.writeObject(authSafe);
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(((ASN1OctetString)info.getContent()).getOctets());

            AuthenticatedSafe   authSafe = new AuthenticatedSafe((ASN1Sequence)bIn.readObject());
            ContentInfo[]       c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        {
            new ContentInfo(data, keyString),
            new ContentInfo(encryptedData, cInfo.getDERObject())
        };

        AuthenticatedSafe   auth = new AuthenticatedSafe(info);

        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        BEROutputStream         berOut = new BEROutputStream(bOut);

        berOut.writeObject(auth);
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(new ByteArrayInputStream(((ASN1OctetString)info.getContent()).getOctets()));

            AuthenticatedSafe   authSafe = new AuthenticatedSafe((ASN1Sequence)bIn.readObject());
            ContentInfo[]       c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        c[0] = new ContentInfo(data, keyString);

        c[1] = new ContentInfo(encryptedData, cInfo.getDERObject());

        AuthenticatedSafe   auth = new AuthenticatedSafe(c);

        bOut.reset();

        BEROutputStream         berOut = new BEROutputStream(bOut);
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.AuthenticatedSafe

        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(((ASN1OctetString)info.getContent()).getOctets());

            AuthenticatedSafe   authSafe = new AuthenticatedSafe((ASN1Sequence)bIn.readObject());
            ContentInfo[]       c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
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.