Package org.apache.geronimo.util.asn1

Examples of org.apache.geronimo.util.asn1.DERObjectIdentifier


                        new DEREnumerated(result)));
            }
            String mechanism = getMechanism();
            if (mechanism != null) {
                fields.add(new DERTaggedObject(true, 1,
                        new DERObjectIdentifier(mechanism)));
            }
            byte[] mechanismToken = getMechanismToken();
            if (mechanismToken != null) {
                fields.add(new DERTaggedObject(true, 2,
                        new DEROctetString(mechanismToken)));
View Full Code Here


                DEREnumerated enumerated =
                        DEREnumerated.getInstance(tagged, true);
                setResult(enumerated.getValue().intValue());
                break;
            case 1:
                DERObjectIdentifier mechanism =
                        DERObjectIdentifier.getInstance(tagged, true);
                setMechanism(mechanism.getId());
                break;
            case 2:
                ASN1OctetString mechanismToken =
                        ASN1OctetString.getInstance(tagged, true);
                setMechanismToken(mechanismToken.getOctets());
View Full Code Here

    public byte[] toByteArray() {
        try {
            ByteArrayOutputStream collector = new ByteArrayOutputStream();
            DEROutputStream der = new DEROutputStream(collector);
            der.writeObject(new DERObjectIdentifier(
                    SpnegoConstants.SPNEGO_MECHANISM));
            ASN1EncodableVector fields = new ASN1EncodableVector();
            String[] mechanisms = getMechanisms();
            if (mechanisms != null) {
                ASN1EncodableVector vector = new ASN1EncodableVector();
                for (int i = 0; i < mechanisms.length; i++) {
                    vector.add(new DERObjectIdentifier(mechanisms[i]));
                }
                fields.add(new DERTaggedObject(true, 0,
                        new DERSequence(vector)));
            }
            int contextFlags = getContextFlags();
View Full Code Here

                (DERTags.CONSTRUCTED | DERTags.APPLICATION)) {
            throw new IOException("Malformed NegTokenInit.");
        }
        tokenStream = new ByteArrayInputStream(constructed.getData());
        der = new DERInputStream(tokenStream);
        DERObjectIdentifier spnego = (DERObjectIdentifier) der.readObject();
        ASN1TaggedObject tagged = (ASN1TaggedObject) der.readObject();
        ASN1Sequence sequence = ASN1Sequence.getInstance(tagged, true);
        Enumeration fields = sequence.getObjects();
        while (fields.hasMoreElements()) {
            tagged = (ASN1TaggedObject) fields.nextElement();
            switch (tagged.getTagNo()) {
            case 0:
                sequence = ASN1Sequence.getInstance(tagged, true);
                String[] mechanisms = new String[sequence.size()];
                for (int i = mechanisms.length - 1; i >= 0; i--) {
                    DERObjectIdentifier mechanism = (DERObjectIdentifier)
                            sequence.getObjectAt(i);
                    mechanisms[i] = mechanism.getId();
                }
                setMechanisms(mechanisms);
                break;
            case 1:
                DERBitString contextFlags = DERBitString.getInstance(tagged,
View Full Code Here

        PrivateKey          signingKey,
        String              provider)
        throws NoSuchAlgorithmException, NoSuchProviderException,
                InvalidKeyException, SignatureException
    {
        DERObjectIdentifier sigOID = (DERObjectIdentifier)algorithms.get(signatureAlgorithm.toUpperCase());

        if (sigOID == null)
        {
            throw new IllegalArgumentException("Unknown signature type requested");
        }
View Full Code Here

         while (it.hasMoreElements()) {
            String idp = (String) it.nextElement();
            String sdp = (String) mappings.get(idp);
            ASN1EncodableVector dv = new ASN1EncodableVector();
            dv.add(new DERObjectIdentifier(idp));
            dv.add(new DERObjectIdentifier(sdp));
            dev.add(new DERSequence(dv));
         }

         seq = new DERSequence(dev);
      }
View Full Code Here

    }

    public AlgorithmIdentifier(
        String     objectId)
    {
        this.objectId = new DERObjectIdentifier(objectId);
    }
View Full Code Here

            HashSet            set = new HashSet();
            Enumeration        e = extensions.oids();

            while (e.hasMoreElements())
            {
                DERObjectIdentifier    oid = (DERObjectIdentifier)e.nextElement();
                X509Extension        ext = extensions.getExtension(oid);

                if (critical == ext.isCritical())
                {
                    set.add(oid.getId());
                }
            }

            return set;
        }
View Full Code Here

    {
        X509Extensions exts = c.getExtensions();

        if (exts != null)
        {
            X509Extension ext = exts.getExtension(new DERObjectIdentifier(oid));

            if (ext != null)
            {
                try
                {
View Full Code Here

            {
                buf.append("   crlEntryExtensions:" + nl);

                while ( e.hasMoreElements() )
                {
                    DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
                    X509Extension ext = extensions.getExtension(oid);
                    buf.append(ext);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.util.asn1.DERObjectIdentifier

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.