• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GSIConstants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.globus.gsi.GSIConstants的典型用法代码示例。如果您正苦于以下问题:Java GSIConstants类的具体用法?Java GSIConstants怎么用?Java GSIConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GSIConstants类属于org.globus.gsi包,在下文中一共展示了GSIConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: test2

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void test2() throws Exception {
    URL u = new URL("httpg://pitcairn.mcs.anl.gov:2119/jobmanager");
    
    URLConnection con = u.openConnection();
    
    assertTrue(con instanceof GSIURLConnection);
    
    ((GSIURLConnection)con).setDelegationType(GSIConstants.DELEGATION_FULL);
    
    try {
        InputStream in = con.getInputStream();
        fail("did not throw exception");
    } catch (IOException e) {
        // everything is cool
    } finally {
        ((GSIURLConnection)con).disconnect();
    }
    
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:20,代码来源:GSIHttpURLConnectionTest.java


示例2: setGssMode

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
protected void setGssMode(Object value) 
    throws GSSException {
    if (!(value instanceof Integer)) {
        throw new GlobusGSSException(GSSException.FAILURE,
                                     GlobusGSSException.BAD_OPTION_TYPE,
                                     "badType",
                                     new Object [] {"GSS mode", Integer.class});
    }
    Integer v = (Integer)value;
    if (v == GSIConstants.MODE_GSI || 
        v == GSIConstants.MODE_SSL) {
        this.gssMode = v;
    } else {
        throw new GlobusGSSException(GSSException.FAILURE,
                                     GlobusGSSException.BAD_OPTION,
                                     "badGssMode");
    }
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:19,代码来源:GlobusGSSContextImpl.java


示例3: setDelegationType

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
protected void setDelegationType(Object value) 
    throws GSSException {
    if (!(value instanceof Integer)) {
        throw new GlobusGSSException(GSSException.FAILURE,
                                     GlobusGSSException.BAD_OPTION_TYPE,
                                     "badType",
                                     new Object[] {"delegation type",  Integer.class});
    }
    Integer v = (Integer)value;
    if (v == GSIConstants.DELEGATION_TYPE_FULL ||
        v == GSIConstants.DELEGATION_TYPE_LIMITED) {
        this.delegationType = v;
    } else {
        throw new GlobusGSSException(GSSException.FAILURE,
                                     GlobusGSSException.BAD_OPTION,
                                     "badDelegType");
    }
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:19,代码来源:GlobusGSSContextImpl.java


示例4: checkProxyName

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
/**
    * Returns proxy name. 
    *
    * @deprecated Only works for Globus legacy proxies.
    */
   public static int checkProxyName(X509Cert cert) {
int rs = -1;
DistinguishedName subject = dupName(cert.getSubjectName());
Vector subjectDN = subject.getName();
Vector lastAva = (Vector)subjectDN.elementAt(subjectDN.size()-1);
String [] ava = (String[])lastAva.elementAt(0);

if (ava[0].equalsIgnoreCase("CN")) {
    if (ava[1].equalsIgnoreCase("proxy")) {
	rs = GSIConstants.GSI_2_PROXY;
    } else if (ava[1].equalsIgnoreCase("limited proxy")) {
	rs = GSIConstants.GSI_2_LIMITED_PROXY;
    }
	
    if (rs != -1) {
	Vector nameDN = dupName(cert.getIssuerName()).getName();
	nameDN.addElement(lastAva);
	X509Name newName = new X509Name(nameDN);

	return (Arrays.equals(subject.getNameDER(), newName.getNameDER())) ? rs : -1;
    }
}

return rs;
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:31,代码来源:PureTLSUtil.java


示例5: testResctrictedNoProxyCertInfoExt

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void testResctrictedNoProxyCertInfoExt() throws Exception {

GlobusCredential cred = GlobusCredential.getDefaultCredential();

try {
    factory.createCredential(cred.getCertificateChain(),
			     cred.getPrivateKey(),
			     512,
			     60 * 60,
			     GSIConstants.GSI_3_RESTRICTED_PROXY,
			     (X509ExtensionSet)null,
			     null);
    fail("Expected to fail");
} catch (IllegalArgumentException e) {
    // that's what we expected
}
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:18,代码来源:BouncyCastleCertProcessingFactoryTest.java


示例6: changeGlobusProxy

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
/**
 * Change the type of the Globus Proxy Credential with optional new
 * ExtensionSet. Older implementations and for example VOMS enabled proxies
 * must be of of GSI_2_PROXY type.
 * 
 * @param proxy
 *            - original Globus Proxy
 * @param proxyType
 *            - new Proxy Type, for example 'legacy' type:
 *            <code>GSIConstants.GSI_2_PROXY</code>
 * @param extensions
 *            - X509ExtensionSet, if null extensions will be removed.
 * @return new changed GlobusCredential.
 * @throws GeneralSecurityException
 * @see GSIConstants
 */
public static GlobusCredential changeGlobusProxy(GlobusCredential proxy, int proxyType, X509ExtensionSet extensions)
        throws GeneralSecurityException
{
    BouncyCastleCertProcessingFactory factory = BouncyCastleCertProcessingFactory.getDefault();

    if (proxyType <= 0)
    {
        proxyType = GSIConstants.GSI_2_PROXY;
    }

    int timeLeft = (int) proxy.getTimeLeft();
    int numBits = proxy.getStrength();
    GlobusCredential newProxy = factory.createCredential(proxy.getCertificateChain(),
            proxy.getPrivateKey(),
            numBits,
            timeLeft,
            proxyType,
            extensions,
            null);

    return newProxy;
}
 
开发者ID:NLeSC,项目名称:vbrowser,代码行数:39,代码来源:GlobusUtil.java


示例7: makeProxy

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
private GlobusCredential makeProxy(KeyPair kp, X509Certificate issuerCert) throws GeneralSecurityException {
    BouncyCastleCertProcessingFactory factory = BouncyCastleCertProcessingFactory.getDefault();
    KeyPair newKeyPair = CertUtil.generateKeyPair(CA_CERT_ALGORITHM, CA_CERT_BITS);
    
    return factory.createCredential(new X509Certificate[] { issuerCert },
            kp.getPrivate(), CA_CERT_BITS, (int) (CA_CERT_LIFETIME / 1000), GSIConstants.DELEGATION_FULL,
            (X509ExtensionSet) null);
}
 
开发者ID:swift-lang,项目名称:swift-k,代码行数:9,代码来源:AutoCA.java


示例8: generateNewCredential

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
private GlobusCredential generateNewCredential(Key key) throws GlobusCredentialException,
        InvalidSecurityContextException, GeneralSecurityException {
    GlobusCredential src = GlobusCredential.getDefaultCredential();
    if (src == null) {
        throw new InvalidSecurityContextException("No default credential found");
    }

    // If only the security stuff in [email protected] would be
    // separable from the WS crap
    BouncyCastleCertProcessingFactory factory =
                BouncyCastleCertProcessingFactory.getDefault();
    int delegType = (key.delegationType == Delegation.FULL_DELEGATION ?
                GSIConstants.DELEGATION_FULL : GSIConstants.DELEGATION_LIMITED);

    KeyPair newKeyPair = CertUtil.generateKeyPair("RSA", src.getStrength());

    X509Certificate[] srcChain = src.getCertificateChain();
    X509Certificate newCert = null;

    try {
        newCert = factory.createProxyCertificate(srcChain[0],
                                    src.getPrivateKey(),
                                    newKeyPair.getPublic(), -1,
                                    key.delegationType == Delegation.FULL_DELEGATION ?
                                            GSIConstants.DELEGATION_FULL
                                            : GSIConstants.DELEGATION_LIMITED,
                                    (X509ExtensionSet) null, null);
    }
    catch (GeneralSecurityException e) {
        throw new InvalidSecurityContextException("Delegation failed", e);
    }

    X509Certificate[] newChain = new X509Certificate[srcChain.length + 1];
    newChain[0] = newCert;
    System.arraycopy(srcChain, 0, newChain, 1, srcChain.length);

    return new GlobusCredential(newKeyPair.getPrivate(), newChain);
}
 
开发者ID:swift-lang,项目名称:swift-k,代码行数:39,代码来源:ProxyForwardingManager.java


示例9: createProxy

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public GlobusCredential createProxy(String pwd)
throws Exception {   

getProperties();

userCert = CertUtil.loadCertificate(props.getUserCertFile());

OpenSSLKey key = 
    new BouncyCastleOpenSSLKey(props.getUserKeyFile());

if (key.isEncrypted()) {
    try {
	key.decrypt(pwd);
    } catch(GeneralSecurityException e) {
	throw new Exception("Wrong password or other security error");
    }
}

PrivateKey userKey = key.getPrivateKey();

BouncyCastleCertProcessingFactory factory =
    BouncyCastleCertProcessingFactory.getDefault();

int proxyType = (getLimited()) ? 
    GSIConstants.DELEGATION_LIMITED :
    GSIConstants.DELEGATION_FULL;

return factory.createCredential(new X509Certificate[] {userCert},
				userKey,
				props.getProxyStrength(), 
				props.getProxyLifeTime() * 3600,
				proxyType,
				(X509ExtensionSet)null);
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:35,代码来源:DefaultGridProxyModel.java


示例10: setRequestProperty

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void setRequestProperty(String key, String value) {
    if (key.equals(GSS_MODE_PROPERTY)) {
        if (value.equals("ssl")) {
            setGSSMode(GSIConstants.MODE_SSL);
        } else if (value.equals("gsi")) {
            setGSSMode(GSIConstants.MODE_GSI);
        } else {
            setGSSMode(null);
        }
    } else {
        super.setRequestProperty(key, value);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:14,代码来源:GSIURLConnection.java


示例11: testGetCertificateType3

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void testGetCertificateType3() throws Exception {
X509Certificate cert = getCertificate(1);
int type = Integer.parseInt(ProxyPathValidatorTest.certs[1][0]);
assertEquals(GSIConstants.EEC, BouncyCastleUtil.getCertificateType(cert));

TrustedCertificates trustedCerts =
    new TrustedCertificates(new X509Certificate[] {cert});

assertEquals(GSIConstants.CA, BouncyCastleUtil.getCertificateType(cert, trustedCerts));
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:11,代码来源:BouncyCastleUtilTest.java


示例12: testExtensions

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void testExtensions() throws Exception {

GlobusCredential cred = GlobusCredential.getDefaultCredential();
X509Extension ext = null;

String oid1 = "1.2.3.4";
String expectedValue1 = "foo";
boolean critical1 = false;

String oid2 = "5.6.7.8";
String expectedValue2 = "bar";
boolean critical2 = true;

X509ExtensionSet extSet = new X509ExtensionSet();
ext = new X509Extension(oid1, critical1, expectedValue1.getBytes());
extSet.add(ext);
ext = new X509Extension(oid2, critical2, expectedValue2.getBytes());
extSet.add(ext);

GlobusCredential newCred = 
    factory.createCredential(cred.getCertificateChain(),
			     cred.getPrivateKey(),
			     512,
			     60 * 60,
			     GSIConstants.GSI_3_IMPERSONATION_PROXY,
			     extSet,
			     null);

X509Certificate newCert = newCred.getCertificateChain()[0];

System.out.println(newCert);

verifyExtension(newCert, oid1, expectedValue1, critical1);
verifyExtension(newCert, oid2, expectedValue2, critical2);
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:36,代码来源:BouncyCastleCertProcessingFactoryTest.java


示例13: GassOutputStream

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
/**
    * Opens Gass output stream in secure mode with specified
    * user credentials.
    *
    * @param cred user credentials to use. If null,
    *             default user credentials will be used.
    * @param host host name of the gass server.
    * @param port port number of the gass server.
    * @param file name of the file on the remote side.
    * @param length total size of the data to be transfered.
    *               Use -1 if unknown. The data then will be 
    *               transfered in chunks.
    * @param append if true, append data to existing file.
    *               Otherwise, the file will be overwritten.
    */
   public GassOutputStream(GSSCredential cred,
		    Authorization auth,
		    String host,
		    int port,
		    String file,
		    long length,
		    boolean append) 
throws GassException, GSSException, IOException {
super();

this.size = length;
this.append = append;

GSSManager manager = ExtendedGSSManager.getInstance();

ExtendedGSSContext context = 
    (ExtendedGSSContext)manager.createContext(null, 
					      GSSConstants.MECH_OID,
					      cred,
					      GSSContext.DEFAULT_LIFETIME);

context.setOption(GSSConstants.GSS_MODE, GSIConstants.MODE_SSL);

GssSocketFactory factory = GssSocketFactory.getDefault();

socket = factory.createSocket(host, port, context);

((GssSocket)socket).setAuthorization(auth);

put(host, file, length, -1);
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:47,代码来源:GassOutputStream.java


示例14: createImpersonationProxyCertificate

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public static X509Certificate[] createImpersonationProxyCertificate(String provider, X509Certificate[] certs,
	PrivateKey privateKey, PublicKey proxyPublicKey, int lifetimeHours, int lifetimeMinutes, int lifetimeSeconds,
	int delegationPathLength, String signatureAlgorithm) throws GeneralSecurityException {
	ProxyPolicy policy = new ProxyPolicy(ProxyPolicy.IMPERSONATION);
	ProxyCertInfo proxyCertInfo = new ProxyCertInfo(delegationPathLength, policy);
	org.globus.gsi.X509Extension x509Ext = new ProxyCertInfoExtension(proxyCertInfo);
	X509ExtensionSet extSet = new X509ExtensionSet();
	extSet.add(x509Ext);
	return createProxyCertificate(provider, certs, privateKey, proxyPublicKey, lifetimeHours, lifetimeMinutes,
		lifetimeSeconds, GSIConstants.GSI_4_IMPERSONATION_PROXY, extSet, signatureAlgorithm);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:12,代码来源:ProxyCreator.java


示例15: configure

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void configure(Stub stub) throws CommunicationStyleException{
	try{
	stub._setProperty(Constants.GSI_SEC_CONV, GSIConstants.ENCRYPTION);
	if (credential != null) {
		GSSCredential gss = new GlobusGSSCredentialImpl(credential, GSSCredential.INITIATE_AND_ACCEPT);
		stub._setProperty(org.globus.axis.gsi.GSIConstants.GSI_CREDENTIALS, gss);
	}
	}catch(Exception e){
		e.printStackTrace();
		throw new CommunicationStyleException(e.getMessage());
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:13,代码来源:SecureConversationWithEncryption.java


示例16: configure

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void configure(Stub stub) throws CommunicationStyleException {
	try {
		stub._setProperty(Constants.GSI_SEC_CONV, GSIConstants.ENCRYPTION);
		stub._setProperty(org.globus.wsrf.security.Constants.GSI_ANONYMOUS,
				Boolean.TRUE);
	} catch (Exception e) {
		e.printStackTrace();
		throw new CommunicationStyleException(e.getMessage());
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:AnonymousSecureConversationWithEncryption.java


示例17: configure

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void configure(Stub stub) throws CommunicationStyleException{
	try{
		Util.registerTransport();
	stub._setProperty(GSIConstants.GSI_TRANSPORT, GSIConstants.ENCRYPTION);
	if (credential != null) {
		GSSCredential gss = new GlobusGSSCredentialImpl(credential, GSSCredential.INITIATE_AND_ACCEPT);
		stub._setProperty(org.globus.axis.gsi.GSIConstants.GSI_CREDENTIALS, gss);
	}
	}catch(Exception e){
		e.printStackTrace();
		throw new CommunicationStyleException(e.getMessage());
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:14,代码来源:SecureTransportWithEncryption.java


示例18: configure

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void configure(Stub stub) throws CommunicationStyleException {
	try {
		Util.registerTransport();
		stub._setProperty(GSIConstants.GSI_TRANSPORT, GSIConstants.ENCRYPTION);
		stub._setProperty(Constants.GSI_ANONYMOUS, Boolean.TRUE);
	} catch (Exception e) {
		e.printStackTrace();
		throw new CommunicationStyleException(e.getMessage());
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:AnonymousSecureTransportWithEncryption.java


示例19: authenticate

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
public void authenticate(AuthenticationProtocolClient authenticationprotocolclient, String s) throws IOException, TerminatedStateException {
    try {
        logger.finest("Registering gss-ssh return messages.");
        authenticationprotocolclient.registerMessage(com.sshtools.j2ssh.authentication.SshMsgUserauthGssapiResponse.class, 60);
        authenticationprotocolclient.registerMessage(com.sshtools.j2ssh.authentication.SshMsgUserauthGssapiToken.class, 61);
        authenticationprotocolclient.registerMessage(com.sshtools.j2ssh.authentication.SshMsgUserauthGssapiError.class, 64);
        authenticationprotocolclient.registerMessage(com.sshtools.j2ssh.authentication.SshMsgUserauthGssapiErrtok.class, 65);
        logger.finest("Sending gssapi user auth request.");
        ByteArrayWriter bytearraywriter = new ByteArrayWriter();
        bytearraywriter.writeUINT32(new UnsignedInteger32(1L));
        byte abyte0[] = GSSConstants.MECH_OID.getDER();
        bytearraywriter.writeBinaryString(abyte0);
        logger.finest("Username:" + getUsername());
        SshMsgUserAuthRequest sshmsguserauthrequest = new SshMsgUserAuthRequest(getUsername(), s, "gssapi", bytearraywriter.toByteArray());
        authenticationprotocolclient.sendMessage(sshmsguserauthrequest);
        logger.finest("Receiving user auth response:");
        SshMsgUserauthGssapiResponse sshmsguserauthgssapiresponse = (SshMsgUserauthGssapiResponse) authenticationprotocolclient.readMessage(60);
        ByteArrayReader bytearrayreader = new ByteArrayReader(sshmsguserauthgssapiresponse.getRequestData());
        byte abyte1[] = bytearrayreader.readBinaryString();
        if (logger.isLoggable(Level.FINEST)) {
            logger.log(Level.FINEST, "Mechanism requested: " + GSSConstants.MECH_OID);
            logger.log(Level.FINEST, "Mechanism selected: " + new Oid(abyte1));
            logger.log(Level.FINEST, "Verify that selected mechanism is GSSAPI.");
        }
        if (!GSSConstants.MECH_OID.equals(new Oid(abyte1))) {
            logger.warning("Mechanism do not match!");
            throw new IOException("Mechanism do not match!");
        }
        logger.finest("Creating GSS context base on grid credentials.");
        GlobusGSSManagerImpl globusgssmanagerimpl = new GlobusGSSManagerImpl();

        HostAuthorization gssAuth = new HostAuthorization(null);
        GSSName targetName = gssAuth.getExpectedName(null, hostname);

        GSSContext gsscontext = globusgssmanagerimpl.createContext(targetName, new Oid(abyte1), gsscredential, GSSCredential.INDEFINITE_LIFETIME - 1);
        gsscontext.requestCredDeleg(true);
        gsscontext.requestMutualAuth(true);
        gsscontext.requestReplayDet(true);
        gsscontext.requestSequenceDet(true);
        // MOD
        // gsscontext.requestConf(false);
        gsscontext.requestConf(true);

        Object type = GSIConstants.DELEGATION_TYPE_LIMITED;
        gsscontext.requestCredDeleg(false);
        ((ExtendedGSSContext) gsscontext).setOption(GSSConstants.DELEGATION_TYPE, type);

        logger.finest("Starting GSS token exchange.");
        byte abyte2[] = new byte[0];
        do {
            if (gsscontext.isEstablished())
                break;
            byte abyte3[] = gsscontext.initSecContext(abyte2, 0, abyte2.length);
            if (abyte3 != null) {
                ByteArrayWriter bytearraywriter1 = new ByteArrayWriter();
                bytearraywriter1.writeBinaryString(abyte3);
                SshMsgUserauthGssapiToken sshmsguserauthgssapitoken = new SshMsgUserauthGssapiToken(bytearraywriter1.toByteArray());
                authenticationprotocolclient.sendMessage(sshmsguserauthgssapitoken);
            }
            if (!gsscontext.isEstablished()) {
                SshMsgUserauthGssapiToken sshmsguserauthgssapitoken1 = (SshMsgUserauthGssapiToken) authenticationprotocolclient.readMessage(61);
                ByteArrayReader bytearrayreader1 = new ByteArrayReader(sshmsguserauthgssapitoken1.getRequestData());
                abyte2 = bytearrayreader1.readBinaryString();
            }
        } while (true);
        logger.log(Level.FINEST, "Sending gssapi exchange complete.");
        SshMsgUserauthGssapiExchangeComplete sshmsguserauthgssapiexchangecomplete = new SshMsgUserauthGssapiExchangeComplete();
        authenticationprotocolclient.sendMessage(sshmsguserauthgssapiexchangecomplete);
        if (logger.isLoggable(Level.FINEST)) {
            logger.log(Level.FINEST, "Context established.\nInitiator : " + gsscontext.getSrcName() + "\nAcceptor  : " + gsscontext.getTargName() + "\nLifetime  : "
                    + gsscontext.getLifetime() + "\nIntegrity   : " + gsscontext.getIntegState() + "\nConfidentiality   : " + gsscontext.getConfState() + "\nAnonymity : "
                    + gsscontext.getAnonymityState());
        }
    } catch (Throwable t) {
        logger.log(Level.WARNING, "Got Exception: ", t);
        throw new TerminatedStateException(AuthenticationProtocolState.FAILED);
    }
}
 
开发者ID:fast-data-transfer,项目名称:fdt,代码行数:79,代码来源:GSIAuthenticationClient.java


示例20: connect

import org.globus.gsi.GSIConstants; //导入依赖的package包/类
protected void connect() throws ChannelException {
	try {
		if (getContact() != null) {
			HostAuthorization hostAuthz = new HostAuthorization("host");

			Authorization authz = new FallbackAuthorization(new Authorization[] { hostAuthz,
					SelfAuthorization.getInstance() });

			GSSCredential cred = this.getUserContext().getCredential();
			if (cred == null) {
				cred = GSSService.initializeCredentials(true, null, null);
			}

			GSSManager manager = new GlobusGSSManagerImpl();
			ExtendedGSSContext gssContext = (ExtendedGSSContext) manager.createContext(null,
					GSSConstants.MECH_OID, cred, cred.getRemainingLifetime());

			gssContext.requestAnonymity(false);
			gssContext.requestCredDeleg(false);
			//gssContext.requestConf(false);
			gssContext.setOption(GSSConstants.GSS_MODE, GSIConstants.MODE_SSL);
			gssContext.setOption(GSSConstants.DELEGATION_TYPE,
					GSIConstants.DELEGATION_TYPE_LIMITED);
			URI contact = getContact();
			socket = (GssSocket) GssSocketFactory.getDefault().createSocket(contact.getHost(),
					contact.getPort(), gssContext);

			socket.setKeepAlive(true);
			socket.setSoTimeout(0);
			socket.setWrapMode(GSIConstants.MODE_SSL.intValue());
			socket.setAuthorization(authz);
			setSocket(socket);

			logger.info("Connected to " + contact);

			setName(contact.toString());
		}
	}
	catch (Exception e) {
		throw new ChannelException("Failed to start channel " + this, e);
	}
}
 
开发者ID:swift-lang,项目名称:swift-k,代码行数:43,代码来源:GSSChannel.java



注:本文中的org.globus.gsi.GSIConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AxisEndpoint类代码示例发布时间:2022-05-23
下一篇:
Java ColorUtil类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap