Package org.apache.directory.shared.asn1

Examples of org.apache.directory.shared.asn1.Asn1Object


            }

            parent = parent.getParent();
        }

        Value value = current.getValue();

        if ( ( value != null ) && ( value.getData() != null ) )
        {
            return ( current.getExpectedLength() == value.getData().length );
        }
        else
        {
            return current.getExpectedLength() == 0;
        }
View Full Code Here


     */
    public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
    {
        try
        {
            return extended( new Oid( oid ), value );
        }
        catch ( DecoderException e )
        {
            String msg = "Failed to decode the OID " + oid;
            LOG.error( msg );
View Full Code Here

        // default for ordering
        ordering = ASN1Boolean.getInstance(false);
       
        while (e.hasMoreElements())
        {
            ASN1Object o = (ASN1Object) e.nextElement();

            if (o instanceof ASN1TaggedObject)
            {
                DERTaggedObject tagged = (DERTaggedObject) o;
View Full Code Here

                // try to parse the extension value byte[] to an ASN1 object
                byte[] extensionValueBin = certificate.getExtensionValue( oid );
                String extensionValue = null;
                try
                {
                    ASN1Object extension = X509ExtensionUtil.fromExtensionValue( extensionValueBin );
                    extensionValue = extension.toString();
                }
                catch ( IOException e )
                {
                    extensionValue = new String( Hex.encodeHex( extensionValueBin ) );
                }
View Full Code Here

                ASN1TaggedObject nobj = (ASN1TaggedObject) nseq.getObjectAt(1);
                // The name is yet another sequence of GeneralString
                ASN1Sequence sseq = ASN1Sequence.getInstance(nobj.getObject());
                Enumeration<ASN1Object> en = sseq.getObjects();
                while (en.hasMoreElements()) {
                  ASN1Object o = (ASN1Object)en.nextElement();
                    DERGeneralString str = DERGeneralString.getInstance(o);
                    if (ret != null) {
                      ret += "/"+str.getString();
                    } else {
                        ret = str.getString()
View Full Code Here

        DERTaggedObject taggedSpnego = new DERTaggedObject(0, seq);
       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ASN1OutputStream asn1Out = new ASN1OutputStream(out);

        ASN1Object spnegoOIDASN1 =  (ASN1Object) spnegoOid.toASN1Object();
        ASN1Object taggedSpnegoASN1    =    (ASN1Object) taggedSpnego.toASN1Object();
       
        int length = spnegoOIDASN1.getDEREncoded().length + taggedSpnegoASN1.getDEREncoded().length;
        byte [] lenBytes = writeLength(length);
        byte[] appWrap = new byte[lenBytes.length + 1];
       
        appWrap[0] = 0x60;
        for(int i=1; i < appWrap.length; i++){
View Full Code Here

                // try to parse the extension value byte[] to an ASN1 object
                byte[] extensionValueBin = certificate.getExtensionValue( oid );
                String extensionValue = null;
                try
                {
                    ASN1Object extension = X509ExtensionUtil.fromExtensionValue( extensionValueBin );
                    extensionValue = extension.toString();
                }
                catch ( IOException e )
                {
                    extensionValue = new String( Hex.encodeHex( extensionValueBin ) );
                }
View Full Code Here

        DERTaggedObject taggedSpnego = new DERTaggedObject(0, seq);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ASN1OutputStream asn1Out = new ASN1OutputStream(out);

        ASN1Object spnegoOIDASN1 =  (ASN1Object) spnegoOid.toASN1Object();
        ASN1Object taggedSpnegoASN1    =    (ASN1Object) taggedSpnego.toASN1Object();

        int length = spnegoOIDASN1.getDEREncoded().length + taggedSpnegoASN1.getDEREncoded().length;
        byte [] lenBytes = writeLength(length);
        byte[] appWrap = new byte[lenBytes.length + 1];

        appWrap[0] = 0x60;
        for(int i=1; i < appWrap.length; i++){
View Full Code Here

        {
            Cipher              cipher;

            cipher =  CMSEnvelopedHelper.INSTANCE.getSymmetricCipher(encAlg, provider);
          
            ASN1Object sParams = (ASN1Object)_encAlg.getParameters();
   
            if (sParams != null && !(sParams instanceof ASN1Null))
            {
                AlgorithmParameters params = CMSEnvelopedHelper.INSTANCE.createAlgorithmParameters(encAlg, cipher.getProvider().getName());

                params.init(sParams.getEncoded(), "ASN.1");
   
                cipher.init(Cipher.DECRYPT_MODE, sKey, params);
            }
            else
            {
View Full Code Here

    }

    public Asn1Set getUnprotectedAttrs()
        throws IOException
    {
        Asn1Object o = _seq.readObject();
       
        if (o != null)
        {
            return (Asn1Set)((Asn1TaggedObject)o).getObject(BerTag.SET, false);
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.Asn1Object

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.