Examples of DEROctetString


Examples of org.bouncycastle.asn1.DEROctetString

        if (aCert.hasUnsupportedCriticalExtension())
        {
            fail("unsupported extensions found with no extensions");
        }
       
        gen.addExtension("1.1", true, new DEROctetString(new byte[10]));
       
        gen.addExtension("2.2", false, new DEROctetString(new byte[20]));
       
        aCert = gen.generate(privKey, "BC");
       
        Set exts = aCert.getCriticalExtensionOIDs();
       
        if (exts.size() != 1 || !exts.contains("1.1"))
        {
            fail("critical extension test failed");
        }

        exts = aCert.getNonCriticalExtensionOIDs();
       
        if (exts.size() != 1 || !exts.contains("2.2"))
        {
            fail("non-critical extension test failed");
        }
       
        if (!aCert.hasUnsupportedCriticalExtension())
        {
            fail("unsupported extensions not found");
        }
       
        byte[]        extString = aCert.getExtensionValue("1.1");
        ASN1Encodable extValue = X509ExtensionUtil.fromExtensionValue(extString);
       
        if (!extValue.equals(new DEROctetString(new byte[10])))
        {
            fail("wrong extension value found for 1.1");
        }
       
        testCertWithBaseCertificateID();
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

        return keyidentifier;
    }

    public ASN1Primitive toASN1Primitive()
    {
        return new DEROctetString(keyidentifier);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

                        ecP.getH().intValue());
            }

            DERBitString    bits = info.getPublicKeyData();
            byte[]          data = bits.getBytes();
            ASN1OctetString key = new DEROctetString(data);

            //
            // extra octet string - one of our old certs...
            //
            if (data[0] == 0x04 && data[1] == data.length - 2
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

            extractBytes(encKey, 0, bX);
            extractBytes(encKey, 32, bY);

            try
            {
                info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(CryptoProObjectIdentifiers.gostR3410_2001, params), new DEROctetString(encKey));
            }
            catch (IOException e)
            {
                return null;
            }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

        else if (tag == iPAddress)
        {
            byte[] enc = toGeneralNameEncoding(name);
            if (enc != null)
            {
                this.obj = new DEROctetString(enc);
            }
            else
            {
                throw new IllegalArgumentException("IP Address is invalid");
            }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

        AlgorithmIdentifier algId,
        ASN1Encodable       privateKey,
        ASN1Set             attributes)
        throws IOException
    {
        this.privKey = new DEROctetString(privateKey.toASN1Primitive().getEncoded(ASN1Encoding.DER));
        this.algId = algId;
        this.attributes = attributes;
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

    public EncryptedPrivateKeyInfo(
        AlgorithmIdentifier algId,
        byte[]              encoding)
    {
        this.algId = algId;
        this.data = new DEROctetString(encoding);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

    }

    public IDEACBCPar(
        byte[]  iv)
    {
        this.iv = new DEROctetString(iv);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

    public PKCS12PBEParams(
        byte[]      salt,
        int         iterations)
    {
        this.iv = new DEROctetString(salt);
        this.iterations = new ASN1Integer(iterations);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DEROctetString

    public CAST5CBCParameters(
        byte[]  iv,
        int     keyLength)
    {
        this.iv = new DEROctetString(iv);
        this.keyLength = new ASN1Integer(keyLength);
    }
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.