本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
示例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();
}