本文整理汇总了Java中org.globus.gsi.proxy.ext.ProxyCertInfo类的典型用法代码示例。如果您正苦于以下问题:Java ProxyCertInfo类的具体用法?Java ProxyCertInfo怎么用?Java ProxyCertInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProxyCertInfo类属于org.globus.gsi.proxy.ext包,在下文中一共展示了ProxyCertInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCertificate
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
/**
* @deprecated
*
* @see #createCertificate(InputStream, X509Certificate, PrivateKey,
* int, int, ProxyCertInfo, String) createCertificate
*/
public X509Certificate createCertificate(InputStream certRequestInputStream,
X509Certificate cert,
PrivateKey privateKey,
int lifetime,
int delegationMode,
ProxyCertInfo proxyCertInfoExt)
throws IOException, GeneralSecurityException {
return createCertificate(certRequestInputStream,
cert,
privateKey,
lifetime,
delegationMode,
proxyCertInfoExt,
null);
}
示例2: testValidatePathWithRestrictedProxy
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
public void testValidatePathWithRestrictedProxy() throws Exception {
X509Certificate [] chain = null;
// GSI 3 PC restricted, EEC, CA
chain = new X509Certificate[] {goodCertsArr[8], goodCertsArr[1], goodCertsArr[0]};
validateChain(chain, ProxyPathValidatorException.UNKNOWN_POLICY);
// // GSI 3 PC impersonation, GSI 3 PC restricted, EEC, CA
chain = new X509Certificate[] {goodCertsArr[9], goodCertsArr[8],
goodCertsArr[1], goodCertsArr[0]};
validateChain(chain, ProxyPathValidatorException.UNKNOWN_POLICY);
TestProxyPathValidator v = new TestProxyPathValidator();
v.setProxyPolicyHandler("1.3.6.1.4.1.3536.1.1.1.8", new ProxyPolicyHandler() {
public void validate(ProxyCertInfo info, X509Certificate[] path, int index)
throws ProxyPathValidatorException {
ProxyPolicy policy = info.getProxyPolicy();
String pol = policy.getPolicyAsString();
assertEquals("<AllPermissions...>\r\n", pol);
}
});
chain = new X509Certificate[] {goodCertsArr[8], goodCertsArr[1], goodCertsArr[0]};
v.validate(chain);
}
示例3: checkUnsupportedCriticalExtensions
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected void checkUnsupportedCriticalExtensions(TBSCertificateStructure crt, int certType,
X509Certificate checkedProxy) throws ProxyPathValidatorException {
logger.debug("enter: checkUnsupportedCriticalExtensions");
X509Extensions extensions = crt.getExtensions();
if (extensions != null) {
Enumeration e = extensions.oids();
while (e.hasMoreElements()) {
DERObjectIdentifier oid = (DERObjectIdentifier) e.nextElement();
X509Extension ext = extensions.getExtension(oid);
if (ext.isCritical()) {
if (oid.equals(X509Extensions.BasicConstraints) || oid.equals(X509Extensions.KeyUsage)
|| (oid.equals(ProxyCertInfo.OID) && CertUtil.isGsi4Proxy(certType))
|| (oid.equals(ProxyCertInfo.OLD_OID) && CertUtil.isGsi3Proxy(certType))) {
} else {
throw new ProxyPathValidatorException(ProxyPathValidatorException.UNSUPPORTED_EXTENSION,
checkedProxy, "Unsuppored critical exception : " + oid.getId());
}
}
}
}
logger.debug("exit: checkUnsupportedCriticalExtensions");
}
示例4: createProxyCertificate
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
/**
* @deprecated Please use
* {@link #createProxyCertificate(X509Certificate, PrivateKey, PublicKey,
* int, int, X509ExtensionSet, String) createProxyCertificate()} instead.
* The <code>ProxyCertInfo</code> parameter can be passed in the
* <code>X509ExtensionSet</code> using
* {@link org.globus.gsi.proxy.ext.ProxyCertInfoExtension
* ProxyCertInfoExtension} class.
*/
public X509Certificate createProxyCertificate(X509Certificate issuerCert,
PrivateKey issuerKey,
PublicKey publicKey,
int lifetime,
int proxyType,
ProxyCertInfo proxyCertInfo,
String cnValue)
throws GeneralSecurityException {
return createProxyCertificate(issuerCert, issuerKey,
publicKey, lifetime,
proxyType,
createExtensionSet(proxyCertInfo),
cnValue);
}
示例5: createCredential
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
/**
* @deprecated Please use
* {@link #createCredential(X509Certificate[], PrivateKey, int,
* int, int, X509ExtensionSet, String) createCredential()}
* instead. The <code>ProxyCertInfo</code> parameter can be passed in the
* <code>X509ExtensionSet</code> using
* {@link org.globus.gsi.proxy.ext.ProxyCertInfoExtension
* ProxyCertInfoExtension} class.
*/
public GlobusCredential createCredential(X509Certificate [] certs,
PrivateKey privateKey,
int bits,
int lifetime,
int delegationMode,
ProxyCertInfo proxyCertInfoExt,
String cnValue)
throws GeneralSecurityException {
return createCredential(certs, privateKey, bits, lifetime,
delegationMode,
createExtensionSet(proxyCertInfoExt),
cnValue);
}
示例6: checkUnsupportedCriticalExtensions
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected void checkUnsupportedCriticalExtensions(TBSCertificateStructure crt,
int certType,
X509Certificate checkedProxy)
throws ProxyPathValidatorException {
logger.debug("enter: checkUnsupportedCriticalExtensions");
X509Extensions extensions = crt.getExtensions();
if (extensions != null) {
Enumeration e = extensions.oids();
while (e.hasMoreElements()) {
DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
X509Extension ext = extensions.getExtension(oid);
if (ext.isCritical()) {
if (oid.equals(X509Extensions.BasicConstraints) ||
oid.equals(X509Extensions.KeyUsage) ||
(oid.equals(ProxyCertInfo.OID) &&
CertUtil.isGsi4Proxy(certType)) ||
(oid.equals(ProxyCertInfo.OLD_OID) &&
CertUtil.isGsi3Proxy(certType))) {
} else {
throw new ProxyPathValidatorException(
ProxyPathValidatorException
.UNSUPPORTED_EXTENSION,
checkedProxy,
"Unsuppored critical exception : "
+ oid.getId());
}
}
}
}
logger.debug("exit: checkUnsupportedCriticalExtensions");
}
示例7: getProxyCertInfo
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected ProxyCertInfo getProxyCertInfo(TBSCertificateStructure crt)
throws IOException {
X509Extensions extensions = crt.getExtensions();
if (extensions == null) {
return null;
}
X509Extension ext =
extensions.getExtension(ProxyCertInfo.OID);
if (ext == null) {
ext = extensions.getExtension(ProxyCertInfo.OLD_OID);
}
return (ext != null) ? BouncyCastleUtil.getProxyCertInfo(ext) : null;
}
示例8: checkRestrictedProxy
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected void checkRestrictedProxy(TBSCertificateStructure proxy, X509Certificate[] certPath, int index)
throws ProxyPathValidatorException, IOException {
logger.debug("enter: checkRestrictedProxy");
ProxyCertInfo info = getProxyCertInfo(proxy);
// just a sanity check
if (info == null) {
throw new ProxyPathValidatorException(ProxyPathValidatorException.FAILURE, certPath[index],
"Could not retreive ProxyCertInfo extension");
}
ProxyPolicy policy = info.getProxyPolicy();
// another sanity check
if (policy == null) {
throw new ProxyPathValidatorException(ProxyPathValidatorException.FAILURE, certPath[index],
"Could not retreive ProxyPolicy from ProxyCertInfo extension");
}
String pl = policy.getPolicyLanguage().getId();
ProxyPolicyHandler handler = getProxyPolicyHandler(pl);
if (handler == null) {
throw new ProxyPathValidatorException(ProxyPathValidatorException.UNKNOWN_POLICY, certPath[index],
"Unknown policy: " + pl);
}
handler.validate(info, certPath, index);
logger.debug("exit: checkRestrictedProxy");
}
示例9: getProxyCertInfo
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected ProxyCertInfo getProxyCertInfo(TBSCertificateStructure crt) throws IOException {
X509Extensions extensions = crt.getExtensions();
if (extensions == null) {
return null;
}
X509Extension ext = extensions.getExtension(ProxyCertInfo.OID);
if (ext == null) {
ext = extensions.getExtension(ProxyCertInfo.OLD_OID);
}
return (ext != null) ? BouncyCastleUtil.getProxyCertInfo(ext) : null;
}
示例10: createImpersonationProxyCertificate
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的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);
}
示例11: createCertificate
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
/**
* @deprecated
* @see #createCertificate(InputStream, X509Certificate, PrivateKey, int,
* int, ProxyCertInfo, String) createCertificate
*/
public X509Certificate createCertificate(String provider, InputStream certRequestInputStream, X509Certificate cert,
PrivateKey privateKey, int lifetime, int delegationMode, ProxyCertInfo proxyCertInfoExt) throws IOException,
GeneralSecurityException {
return createCertificate(provider, certRequestInputStream, cert, privateKey, lifetime, delegationMode,
proxyCertInfoExt, null);
}
示例12: getExtentionName
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
public static String getExtentionName(String oid) {
if (oid.equals(subjectKeyIdentifierOID)) {
return "SubjectKeyIdentifier";
} else if (oid.equals(keyUsageOID)) {
return "KeyUsage";
}else if (oid.equals(certificatePolicies)) {
return "CertificatePolicies";
} else if (oid.equals(privateKeyUsageOID)) {
return "PrivateKeyUsage";
} else if (oid.equals(subjectAlternativeNameOID)) {
return "SubjectAlternativeName";
} else if (oid.equals(issuerAlternativeNameOID)) {
return "IssuerAlternativeName";
} else if (oid.equals(basicConstraintsOID)) {
return "BasicConstraints";
} else if (oid.equals(nameConstraintsOID)) {
return "NameConstraints";
} else if (oid.equals(policyMappingsOID)) {
return "PolicyMappings";
} else if (oid.equals(authorityKeyIdentifierOID)) {
return "AuthorityKeyIdentifier";
} else if (oid.equals(policyConstraintsOID)) {
return "PolicyConstraints";
} else if (oid.equals(ProxyCertInfo.OID.getId())) {
return "ProxyCertInfo";
} else {
return "*** UNKNOWN ***";
}
}
示例13: setProxyCertInfo
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
public void setProxyCertInfo(ProxyCertInfo proxyCertInfo) {
this.proxyCertInfo = proxyCertInfo;
}
示例14: checkRestrictedProxy
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected void checkRestrictedProxy(TBSCertificateStructure proxy,
X509Certificate[] certPath,
int index)
throws ProxyPathValidatorException, IOException {
logger.debug("enter: checkRestrictedProxy");
ProxyCertInfo info = getProxyCertInfo(proxy);
// just a sanity check
if (info == null) {
throw new ProxyPathValidatorException(
ProxyPathValidatorException.FAILURE,
certPath[index],
"Could not retreive ProxyCertInfo extension");
}
ProxyPolicy policy = info.getProxyPolicy();
// another sanity check
if (policy == null) {
throw new ProxyPathValidatorException(
ProxyPathValidatorException.FAILURE,
certPath[index],
"Could not retreive ProxyPolicy from ProxyCertInfo extension");
}
String pl = policy.getPolicyLanguage().getId();
ProxyPolicyHandler handler = getProxyPolicyHandler(pl);
if (handler == null) {
throw new ProxyPathValidatorException(
ProxyPathValidatorException.UNKNOWN_POLICY,
certPath[index],
"Unknown policy: " + pl);
}
handler.validate(info, certPath, index);
logger.debug("exit: checkRestrictedProxy");
}
示例15: getProxyPathConstraint
import org.globus.gsi.proxy.ext.ProxyCertInfo; //导入依赖的package包/类
protected int getProxyPathConstraint(TBSCertificateStructure crt)
throws IOException {
ProxyCertInfo proxyCertExt = getProxyCertInfo(crt);
return (proxyCertExt != null) ? proxyCertExt.getPathLenConstraint() : -1;
}