Examples of CipherReferenceType


Examples of com.sun.xml.security.core.xenc.CipherReferenceType

        edt.setMimeType(attachment.getContentType());
        EncryptionMethodType emt = new EncryptionMethodType();
        emt.setAlgorithm(dataAlgo);
        edt.setEncryptionMethod(emt);
        CipherDataType ct = new CipherDataType();
        CipherReferenceType crt = new CipherReferenceType();
        crt.setURI(cid);
        TransformsType tst = new TransformsType();
        ArrayList<TransformType> ttList = new ArrayList<TransformType>();
        ArrayList list = target.getCipherReferenceTransforms();
        for(Object obj : list){
            EncryptionTarget.Transform tr = (EncryptionTarget.Transform)obj;
            TransformType tt = new TransformType();
            tt.setAlgorithm(tr.getTransform());
            ttList.add(tt);
        }
        if(!ttList.isEmpty()){
            tst.setTransform(ttList);
        }
        crt.setTransforms(tst);
        ct.setCipherReference(crt);
        edt.setCipherData(ct);
        edt.setId(id);
        if(keyInfo != null){
            edt.setKeyInfo(keyInfo);
View Full Code Here

Examples of com.sun.xml.security.core.xenc.CipherReferenceType

        edt.setMimeType(attachment.getContentType());
        EncryptionMethodType emt = new EncryptionMethodType();
        emt.setAlgorithm(dataAlgo);
        edt.setEncryptionMethod(emt);
        CipherDataType ct = new CipherDataType();
        CipherReferenceType crt = new CipherReferenceType();
        crt.setURI(cid);
        TransformsType tst = new TransformsType();
        ArrayList<TransformType> ttList = new ArrayList<TransformType>();
        ArrayList list = target.getCipherReferenceTransforms();
        for(Object obj : list){
            EncryptionTarget.Transform tr = (EncryptionTarget.Transform)obj;
            TransformType tt = new TransformType();
            tt.setAlgorithm(tr.getTransform());
            ttList.add(tt);
        }
        if(!ttList.isEmpty()){
            tst.setTransform(ttList);
        }
        crt.setTransforms(tst);
        ct.setCipherReference(crt);
        edt.setCipherData(ct);
        edt.setId(id);
        if(keyInfo != null){
            edt.setKeyInfo(keyInfo);
View Full Code Here

Examples of org.apache.xml.security.binding.xmlenc.CipherReferenceType

        String typeStr = encryptedDataType.getType();
        if (typeStr != null &&
                (WSSConstants.SWA_ATTACHMENT_ENCRYPTED_DATA_TYPE_CONTENT_ONLY.equals(typeStr) ||
                        WSSConstants.SWA_ATTACHMENT_ENCRYPTED_DATA_TYPE_COMPLETE.equals(typeStr))) {

            CipherReferenceType cipherReferenceType = encryptedDataType.getCipherData().getCipherReference();
            if (cipherReferenceType == null) {
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK);
            }

            final String uri = cipherReferenceType.getURI();
            if (uri == null || uri.length() < 5) {
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK);
            }
            if (!uri.startsWith("cid:")) {
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK);
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.