cat.debug("Found attribute: "+a.getAttrType().getId());
log.debug("Found attribute: "+a.getAttrType().getId());
    private void init() throws IOException {        cat.debug(">init");        //Provider BCJce = new org.bouncycastle.jce.provider.BouncyCastleProvider();        //int result = Security.addProvider(BCJce);        // Parse and verify the entegrity of the PKIOperation message PKCS#7        /* If this would have been done using the newer CMS it would have made me so much happier... */        ASN1Sequence seq =(ASN1Sequence)new DERInputStream(new ByteArrayInputStream(msg)).readObject();        ContentInfo ci = new ContentInfo(seq);        String ctoid = ci.getContentType().getId();        if (ctoid.equals(CMSObjectIdentifiers.signedData.getId())) {            // This is SignedData so it is a pkcsCertReqSigned,            //  pkcsGetCertInitialSigned, pkcsGetCertSigned, pkcsGetCRLSigned            // (could also be pkcsRepSigned or certOnly, but we don't receive them on the server side            // Try to find out what kind of message this is            sd = new SignedData((ASN1Sequence)ci.getContent());            Enumeration sis = sd.getSignerInfos().getObjects();            if (sis.hasMoreElements()) {                SignerInfo si = new SignerInfo((ASN1Sequence)sis.nextElement());                Enumeration attr = si.getAuthenticatedAttributes().getObjects();                //Vector attr = si.getSignedAttrs().getAttributes();                while (attr.hasMoreElements()) {                    Attribute a = new Attribute((ASN1Sequence)attr.nextElement());                    //Attribute a = (Attribute)iter.next();                    cat.debug("Found attribute: "+a.getAttrType().getId());                    if (a.getAttrType().getId().equals(id_messageType)) {                        Enumeration values = a.getAttrValues().getObjects();                        DERPrintableString str = DERPrintableString.getInstance(values.nextElement());                        messageType = Integer.parseInt(str.getString());                        cat.debug("Messagetype = "+messageType);                        break; // we can olny handle one message type per message :-)                    }                }            }            // If this is a PKCSReq            if (messageType == 19) {                // Extract the contents, which is an encrypted PKCS10                ci = sd.getEncapContentInfo();                ctoid = ci.getContentType().getId();                if (ctoid.equals(CMSObjectIdentifiers.data.getId())) {                    DEROctetString content = (DEROctetString)ci.getContent();                    cat.debug("envelopedData is "+content.getOctets().length+" bytes.");                    ASN1Sequence seq1 =(ASN1Sequence)new DERInputStream(new ByteArrayInputStream(content.getOctets())).readObject();                    envEncData = new ContentInfo(seq1);                    ctoid = envEncData.getContentType().getId();                    if (ctoid.equals(CMSObjectIdentifiers.envelopedData.getId())) {                        envData = new EnvelopedData((ASN1Sequence)envEncData.getContent());                    } else {                        cat.error("EncapsulatedContentInfo does not contain PKCS7 envelopedData: "+ctoid);                        error = 2;                    }                } else {                    cat.error("EncapsulatedContentInfo is not of type 'data': "+ctoid);                    error = 3;                }            } else {                cat.error("This is not a certification request!");                error = 4;            }        } else {            cat.error("PKCSReq does not contain 'signedData': "+ctoid);            error = 1;        }        cat.debug("<init");    } // init