Package org.apache.geronimo.corba.security.config.tss

Examples of org.apache.geronimo.corba.security.config.tss.TSSSASMechConfig


        return gssupConfig;
    }

    protected static TSSSASMechConfig extractSASMech(TSSSasMechType sasMech, Bundle bundle) throws DeploymentException {

        TSSSASMechConfig sasMechConfig = new TSSSASMechConfig();

        if (sasMech.isSetServiceConfigurationList()) {
            sasMechConfig.setRequired(sasMech.getServiceConfigurationList().getRequired());

            TSSGeneralNameType[] generalNames = sasMech.getServiceConfigurationList().getGeneralNameArray();
            for (int i = 0; i < generalNames.length; i++) {
                sasMechConfig.addServiceConfigurationConfig(new TSSGeneralNameConfig(generalNames[i].getPrivilegeAuthority()));
            }

            TSSGssExportedNameType[] exportedNames = sasMech.getServiceConfigurationList().getGssExportedNameArray();
            for (int i = 0; i < exportedNames.length; i++) {
                sasMechConfig.addServiceConfigurationConfig(new TSSGSSExportedNameConfig(exportedNames[i].getPrivilegeAuthority(), exportedNames[i].getOID()));
            }
        }

        TSSIdentityTokenTypeList identityTokenTypes = sasMech.getIdentityTokenTypes();

        if (identityTokenTypes.isSetITTAbsent()) {
            sasMechConfig.addIdentityToken(new TSSITTAbsent());
        } else {
            if (identityTokenTypes.isSetITTAnonymous()) {
                sasMechConfig.addIdentityToken(new TSSITTAnonymous());
            }
            if (identityTokenTypes.isSetITTPrincipalNameGSSUP()) {
                org.apache.geronimo.corba.xbeans.csiv2.tss.TSSITTPrincipalNameGSSUPType ittPrincipalNameGSSUP = identityTokenTypes.getITTPrincipalNameGSSUP();
                String principalClassName = ittPrincipalNameGSSUP.getPrincipalClass();
                Class principalClass;
                try {
                    principalClass = ClassLoading.loadClass(principalClassName, bundle);
                } catch (ClassNotFoundException e) {
                    throw new DeploymentException("Could not load principal class", e);
                }
                String domainName = ittPrincipalNameGSSUP.isSetDomain() ? ittPrincipalNameGSSUP.getDomain().trim() : null;
                String realmName = null;
                if (domainName != null && ittPrincipalNameGSSUP.isSetRealm()) {
                    realmName = ittPrincipalNameGSSUP.getRealm().trim();
                }


                try {
                    sasMechConfig.addIdentityToken(new TSSITTPrincipalNameGSSUP(principalClass, realmName, domainName));
                } catch (NoSuchMethodException e) {
                    throw new DeploymentException("Could not find principal class constructor", e);
                }
            }
            if (identityTokenTypes.isSetITTDistinguishedName()) {
                String realmName = identityTokenTypes.getITTDistinguishedName().getRealm();
                String domainName = identityTokenTypes.getITTDistinguishedName().getDomain();

                realmName = (realmName == null ? null : realmName.trim());
                domainName = (domainName == null ? null : domainName.trim());
                sasMechConfig.addIdentityToken(new TSSITTDistinguishedName(realmName, domainName));
            }
            if (identityTokenTypes.isSetITTX509CertChain()) {
                String realmName = identityTokenTypes.getITTX509CertChain().getRealm();
                String domainName = identityTokenTypes.getITTX509CertChain().getDomain();

                realmName = (realmName == null ? null : realmName.trim());
                domainName = (domainName == null ? null : domainName.trim());
                sasMechConfig.addIdentityToken(new TSSITTX509CertChain(realmName, domainName));
            }
        }

        return sasMechConfig;
    }
View Full Code Here


        return gssupConfig;
    }

    protected static TSSSASMechConfig extractSASMech(TSSSasMechType sasMech, Bundle bundle) throws DeploymentException {

        TSSSASMechConfig sasMechConfig = new TSSSASMechConfig();

        if (sasMech.isSetServiceConfigurationList()) {
            sasMechConfig.setRequired(sasMech.getServiceConfigurationList().getRequired());

            TSSGeneralNameType[] generalNames = sasMech.getServiceConfigurationList().getGeneralNameArray();
            for (int i = 0; i < generalNames.length; i++) {
                sasMechConfig.addServiceConfigurationConfig(new TSSGeneralNameConfig(generalNames[i].getPrivilegeAuthority()));
            }

            TSSGssExportedNameType[] exportedNames = sasMech.getServiceConfigurationList().getGssExportedNameArray();
            for (int i = 0; i < exportedNames.length; i++) {
                sasMechConfig.addServiceConfigurationConfig(new TSSGSSExportedNameConfig(exportedNames[i].getPrivilegeAuthority(), exportedNames[i].getOID()));
            }
        }

        TSSIdentityTokenTypeList identityTokenTypes = sasMech.getIdentityTokenTypes();

        if (identityTokenTypes.isSetITTAbsent()) {
            sasMechConfig.addIdentityToken(new TSSITTAbsent());
        } else {
            if (identityTokenTypes.isSetITTAnonymous()) {
                sasMechConfig.addIdentityToken(new TSSITTAnonymous());
            }
            if (identityTokenTypes.isSetITTPrincipalNameGSSUP()) {
                org.apache.geronimo.corba.xbeans.csiv2.tss.TSSITTPrincipalNameGSSUPType ittPrincipalNameGSSUP = identityTokenTypes.getITTPrincipalNameGSSUP();
                String principalClassName = ittPrincipalNameGSSUP.getPrincipalClass();
                Class principalClass;
                try {
                    principalClass = ClassLoading.loadClass(principalClassName, bundle);
                } catch (ClassNotFoundException e) {
                    throw new DeploymentException("Could not load principal class", e);
                }
                String domainName = ittPrincipalNameGSSUP.isSetDomain() ? ittPrincipalNameGSSUP.getDomain().trim() : null;
                String realmName = null;
                if (domainName != null && ittPrincipalNameGSSUP.isSetRealm()) {
                    realmName = ittPrincipalNameGSSUP.getRealm().trim();
                }


                try {
                    sasMechConfig.addIdentityToken(new TSSITTPrincipalNameGSSUP(principalClass, realmName, domainName));
                } catch (NoSuchMethodException e) {
                    throw new DeploymentException("Could not find principal class constructor", e);
                }
            }
            if (identityTokenTypes.isSetITTDistinguishedName()) {
                String realmName = identityTokenTypes.getITTDistinguishedName().getRealm();
                String domainName = identityTokenTypes.getITTDistinguishedName().getDomain();

                realmName = (realmName == null ? null : realmName.trim());
                domainName = (domainName == null ? null : domainName.trim());
                sasMechConfig.addIdentityToken(new TSSITTDistinguishedName(realmName, domainName));
            }
            if (identityTokenTypes.isSetITTX509CertChain()) {
                String realmName = identityTokenTypes.getITTX509CertChain().getRealm();
                String domainName = identityTokenTypes.getITTX509CertChain().getDomain();

                realmName = (realmName == null ? null : realmName.trim());
                domainName = (domainName == null ? null : domainName.trim());
                sasMechConfig.addIdentityToken(new TSSITTX509CertChain(realmName, domainName));
            }
        }

        return sasMechConfig;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.corba.security.config.tss.TSSSASMechConfig

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.