本文整理汇总了Java中org.globus.gsi.GSIConstants.CA属性的典型用法代码示例。如果您正苦于以下问题:Java GSIConstants.CA属性的具体用法?Java GSIConstants.CA怎么用?Java GSIConstants.CA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.globus.gsi.GSIConstants
的用法示例。
在下文中一共展示了GSIConstants.CA属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCertificateType
/**
* Returns certificate type of the given certificate.
* This function calls {@link #getCertificateType(TBSCertificateStructure)
* getCertificateType} to get the certificate type. In case
* the certificate type was initially determined as
* {@link GSIConstants#EEC GSIConstants.EEC} it is checked
* against the trusted certificate list to see if it really
* is a CA certificate. If the certificate is present in the
* trusted certificate list the certificate type is changed
* to {@link GSIConstants#CA GSIConstants.CA}. Otherwise, it is
* left as it is (This is useful in cases where a valid CA
* certificate does not have a BasicConstraints extension)
*
* @param crt the certificate to get the type of.
* @param trustedCerts the trusted certificates to double check the
* {@link GSIConstants#EEC GSIConstants.EEC}
* certificate against. If null, a default
* set of trusted certificate will be loaded
* from a standard location.
* @return the certificate type. The certificate type is determined
* by rules described above.
* @exception IOException if something goes wrong.
* @exception CertificateException for proxy certificates, if
* the issuer DN of the certificate does not match
* the subject DN of the certificate without the
* last <I>CN</I> component. Also, for GSI-3 proxies
* when the <code>ProxyCertInfo</code> extension is
* not marked as critical.
*/
public static int getCertificateType(TBSCertificateStructure crt,
TrustedCertificates trustedCerts)
throws CertificateException, IOException {
int type = getCertificateType(crt);
// check subject of the cert in trusted cert list
// to make sure the cert is not a ca cert
if (type == GSIConstants.EEC) {
if (trustedCerts == null) {
trustedCerts =
TrustedCertificates.getDefaultTrustedCertificates();
}
if (trustedCerts != null &&
trustedCerts.getCertificate(crt.getSubject().toString()) != null) {
type = GSIConstants.CA;
}
}
return type;
}