Examples of ASN1Encodable


Examples of org.bouncycastle.asn1.ASN1Encodable

        return "X.509";
    }

    public byte[] getEncoded()
    {
        ASN1Encodable params;
        SubjectPublicKeyInfo info;

        if (algorithm.equals("DSTU4145"))
        {
            if (dstuParams != null)
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

        return "X.509";
    }

    public byte[] getEncoded()
    {
        ASN1Encodable        params;
        SubjectPublicKeyInfo info;

        if (ecSpec instanceof ECNamedCurveSpec)
        {
            ASN1ObjectIdentifier curveOid = ECUtil.getNamedCurveOid(((ECNamedCurveSpec)ecSpec).getName());
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

        if (!isAlgIdEqual(c.getSignatureAlgorithm(), c.getTBSCertificate().getSignature()))
        {
            throw new CertificateException("signature algorithm in TBS cert not same as outer cert");
        }

        ASN1Encodable params = c.getSignatureAlgorithm().getParameters();

        // TODO This should go after the initVerify?
        X509SignatureUtil.setSignatureParameters(signature, params);

        signature.initVerify(key);
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

        Enumeration e = seq.getObjects();
        this.p = ASN1Integer.getInstance(e.nextElement());
        this.g = ASN1Integer.getInstance(e.nextElement());
        this.q = ASN1Integer.getInstance(e.nextElement());

        ASN1Encodable next = getNext(e);

        if (next != null && next instanceof ASN1Integer)
        {
            this.j = ASN1Integer.getInstance(next);
            next = getNext(e);
        }

        if (next != null)
        {
            this.validationParms = DHValidationParms.getInstance(next.toASN1Primitive());
        }
    }
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

                Enumeration e = ((ASN1Sequence)derObject).getObjects();
                certificates = new ArrayList();
                CertificateFactory certFactory = CertificateFactory.getInstance("X.509", BouncyCastleProvider.PROVIDER_NAME);
                while (e.hasMoreElements())
                {
                    ASN1Encodable element = (ASN1Encodable)e.nextElement();
                    byte[] encoded = element.toASN1Primitive().getEncoded(ASN1Encoding.DER);
                    certificates.add(0, certFactory.generateCertificate(
                        new ByteArrayInputStream(encoded)));
                }
            }
            else if (encoding.equalsIgnoreCase("PKCS7") || encoding.equalsIgnoreCase("PEM"))
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

            fail("wrong number of non-critical extensions in OCSP request.");
        }

        byte[] extValue = req.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nonce.getId());

        ASN1Encodable extObj = X509ExtensionUtil.fromExtensionValue(extValue);

        if (!(extObj instanceof ASN1OctetString))
        {
            fail("wrong extension type found.");
        }
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

            fail("wrong number of non-critical extensions in OCSP request.");
        }

        byte[] extValue = req.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nonce.getId());

        ASN1Encodable extObj = X509ExtensionUtil.fromExtensionValue(extValue);

        if (!(extObj instanceof ASN1OctetString))
        {
            fail("wrong extension type found.");
        }
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

            fail("wrong number of non-critical extensions in OCSP request.");
        }

        byte[] extValue = req.getExtensionValue(OCSPObjectIdentifiers.id_pkix_ocsp_nonce.getId());

        ASN1Encodable extObj = X509ExtensionUtil.fromExtensionValue(extValue);

        if (!(extObj instanceof ASN1OctetString))
        {
            fail("wrong extension type found.");
        }
View Full Code Here

Examples of org.bouncycastle.asn1.ASN1Encodable

       
        X509Certificate sign = null;

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

Examples of org.bouncycastle.asn1.ASN1Encodable

                    ecP.getG().getY().toBigInteger()),
                ecP.getN(),
                ecP.getH().intValue());
        }

        ASN1Encodable privKey = info.parsePrivateKey();
        if (privKey instanceof DERInteger)
        {
            DERInteger derD = DERInteger.getInstance(privKey);

            this.d = derD.getValue();
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.