当前位置: 首页>>代码示例>>Java>>正文


Java GlobusCredential.verify方法代码示例

本文整理汇总了Java中org.globus.gsi.GlobusCredential.verify方法的典型用法代码示例。如果您正苦于以下问题:Java GlobusCredential.verify方法的具体用法?Java GlobusCredential.verify怎么用?Java GlobusCredential.verify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.globus.gsi.GlobusCredential的用法示例。


在下文中一共展示了GlobusCredential.verify方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPutGet2

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
public void testPutGet2() throws Exception {
myProxy.put(cred,
	    username,
	    password,
	    lifetime);

GSSCredential mCred = myProxy.get(cred,
				  username,
				  password,
				  lifetime);
assertTrue(mCred != null);
GlobusCredential gCred = 
    ((GlobusGSSCredentialImpl)mCred).getGlobusCredential();
assertTrue(gCred != null);
gCred.verify();
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:17,代码来源:MyProxyTest.java

示例2: check

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
public void check(GlobusCredential credential, Throwable error)
		throws Exception {
	if (error != null) {
		throw new Exception(
				"The following error was received when one was NOT expected: "
						+ error.getMessage(), error);
	}
	if (credential == null) {
		throw new Exception(
				"No grid credential received when one was expected.");
	}
	if ((expectedGridIdentity != null)
			&& (!credential.getIdentity().equals(expectedGridIdentity))) {
		throw new Exception("A credential with the identity "
				+ credential.getIdentity()
				+ " was received when a credential with the identity "
				+ expectedGridIdentity + " was expected.");
	}
	credential.verify();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:SuccessfullGridCredentialRequest.java

示例3: runStep

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
public void runStep() throws Throwable {
	BasicAuthentication ba = new BasicAuthentication();
	ba.setUserId(user.getUserId());
	ba.setPassword(user.getPassword());
	LocalUserClient client = new LocalUserClient(serviceURL);
	client.changePassword(ba, newPassword);
	ba.setPassword(newPassword);
	SAMLAssertion saml = client.authenticate(ba);
	CertificateLifetime lifetime = new CertificateLifetime();
	lifetime.setHours(12);
	GridUserClient client2 = new GridUserClient(this.serviceURL);
	GlobusCredential gridCredential = client2
			.requestUserCertificate(saml, lifetime);
	assertNotNull(gridCredential);
	gridCredential.verify();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:ChangeLocalUserPasswordStep.java

示例4: checkCertificate

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkCertificate(String expectedIdentity, CertificateLifetime lifetime, PrivateKey key,
    X509Certificate cert) throws Exception {
    assertNotNull(cert);

    GlobusCredential cred = new GlobusCredential(key, new X509Certificate[]{cert});
    assertNotNull(cred);
    long max = FederationUtils.getTimeInSeconds(lifetime);
    long min = max - 3;
    long timeLeft = cred.getTimeLeft();
    if ((min > timeLeft) || (timeLeft > max)) {
        assertTrue(false);
    }
    assertEquals(cert.getSubjectDN().toString(), identityToSubject(cred.getIdentity()));
    assertEquals(expectedIdentity, cred.getIdentity());
    assertEquals(getCA().getCACertificate().getSubjectDN(), cert.getIssuerDN());
    cred.verify();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:TestDorian.java

示例5: checkCertificate

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkCertificate(String expectedIdentity, CertificateLifetime lifetime, PrivateKey key,
    X509Certificate cert) throws Exception {
    assertNotNull(cert);
    GlobusCredential cred = new GlobusCredential(key, new X509Certificate[]{cert});
    assertNotNull(cred);
    long max = FederationUtils.getTimeInSeconds(lifetime);
    // what is this 3 for?
    long min = max - 3;
    long timeLeft = cred.getTimeLeft();
    assertTrue(min <= timeLeft);
    assertTrue(timeLeft <= max);
    assertEquals(expectedIdentity, cred.getIdentity());
    assertEquals(cert.getSubjectDN().toString(), identityToSubject(cred.getIdentity()));
    assertEquals(cred.getIssuer(), ca.getCACertificate().getSubjectDN().getName());
    cred.verify();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:TestIdentityFederationManager.java

示例6: checkCertificate

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkCertificate(String expectedIdentity, CertificateLifetime lifetime, PrivateKey key, X509Certificate cert) throws Exception {
	assertNotNull(cert);

	GlobusCredential cred = new GlobusCredential(key, new X509Certificate[] { cert });
	assertNotNull(cred);
	long max = FederationUtils.getTimeInSeconds(lifetime);
	long min = max - 3;
	long timeLeft = cred.getTimeLeft();
	if ((min > timeLeft) || (timeLeft > max)) {
		assertTrue(false);
	}
	assertEquals(cert.getSubjectDN().toString(), identityToSubject(cred.getIdentity()));
	assertEquals(expectedIdentity, cred.getIdentity());
	assertEquals(getCA().getCACertificate().getSubjectDN(), cert.getIssuerDN());
	cred.verify();
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:17,代码来源:TestDorian.java

示例7: testPutGet3

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
public void testPutGet3() throws Exception {
myProxy.put(cred,
	    username,
	    password,
	    lifetime);

GSSCredential mCred = myProxy.get(username,
				  password,
				  lifetime);
assertTrue(mCred != null);
GlobusCredential gCred = 
    ((GlobusGSSCredentialImpl)mCred).getGlobusCredential();
assertTrue(gCred != null);
gCred.verify();
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:16,代码来源:MyProxyTest.java

示例8: verifyCredentials

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void verifyCredentials(GlobusCredential globusCredential)
		throws AuthenticationConfigurationException {
	if (null == globusCredential) {
		throw new AuthenticationConfigurationException(
				"No proxy certificate found");
	}
	try {
		globusCredential.verify();
	} catch (GlobusCredentialException e) {
		log.error(FaultUtil.printFaultToString(e));
		throw new AuthenticationConfigurationException(
				"Error verifying the proxy certificate: " + e.getMessage(), e);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:15,代码来源:ProxyValidatorImpl.java

示例9: checkCertificate

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkCertificate(String expectedIdentity, CertificateLifetime lifetime, PrivateKey key, X509Certificate cert) throws Exception {
	assertNotNull(cert);
	GlobusCredential cred = new GlobusCredential(key, new X509Certificate[] { cert });
	assertNotNull(cred);
	long max = FederationUtils.getTimeInSeconds(lifetime);
	// what is this 3 for?
	long min = max - 3;
	long timeLeft = cred.getTimeLeft();
	assertTrue(min <= timeLeft);
	assertTrue(timeLeft <= max);
	assertEquals(expectedIdentity, cred.getIdentity());
	assertEquals(cert.getSubjectDN().toString(), identityToSubject(cred.getIdentity()));
	assertEquals(cred.getIssuer(), ca.getDefaultCertificateAuthority().getCACertificate().getSubjectDN().getName());
	cred.verify();
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:16,代码来源:TestIdentityFederationManager.java


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