|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.gsi.CertUtil
Contains various security-related utility methods.
| Constructor Summary | |
CertUtil()
|
|
| Method Summary | |
static KeyPair |
generateKeyPair(String algorithm,
int bits)
Generates a key pair of given algorithm and strength. |
protected static CertificateFactory |
getCertificateFactory()
Returns appropriate CertificateFactory. |
static String |
getProxyTypeAsString(int proxyType)
Returns a string description of a specified proxy type. |
static void |
init()
A no-op function that can be used to force the class to load and initialize. |
static void |
installSecureRandomProvider()
Installs SecureRandom provider. |
static boolean |
isGsi2Proxy(int certType)
Determines if a specified certificate type indicates a GSI-2 proxy certificate. |
static boolean |
isGsi3Enabled()
Checks if GSI-3 mode is enabled. |
static boolean |
isGsi3Proxy(int certType)
Determines if a specified certificate type indicates a GSI-3 proxy certificate. |
static boolean |
isGsi4Proxy(int certType)
Determines if a specified certificate type indicates a GSI-4 proxy certificate. |
static boolean |
isImpersonationProxy(int certType)
Determines if a specified certificate type indicates a GSI-2 or GSI-3 impersonation proxy certificate. |
static boolean |
isIndependentProxy(int certType)
Determines if a specified certificate type indicates a GSI-3 or GS-4 limited proxy certificate. |
static boolean |
isLimitedProxy(int certType)
Determines if a specified certificate type indicates a GSI-2 or GSI-3 limited proxy certificate. |
static boolean |
isProxy(int certType)
Determines if a specified certificate type indicates a GSI-2 or GSI-3 proxy certificate. |
static X509Certificate |
loadCertificate(InputStream in)
Loads a X509 certificate from the specified input stream. |
static X509Certificate |
loadCertificate(String file)
Loads an X509 certificate from the specified file. |
static X509Certificate[] |
loadCertificates(String file)
Loads multiple X509 certificates from the specified file. |
static X509CRL |
loadCrl(InputStream in)
|
static X509CRL |
loadCrl(String file)
|
static void |
setProvider(String providerName)
Sets a provider name to use for loading certificates and for generating key pairs. |
static String |
toGlobusID(Principal name)
|
static String |
toGlobusID(String dn)
Converts DN of the form "CN=foo, O=bar" into Globus format "/CN=foo/O=bar" (in the reverse way). |
static String |
toGlobusID(String dn,
boolean reverse)
Converts DN of the form "CN=foo, O=bar" into Globus format "/CN=foo/O=bar". |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CertUtil()
| Method Detail |
public static void init()
public static void setProvider(String providerName)
providerName - provider name to use.
protected static CertificateFactory getCertificateFactory()
throws GeneralSecurityException
CertificateFactory.
If provider was set a provider-specific
CertificateFactory will be used. Otherwise,
a default CertificateFactory will be used.
CertificateFactory
GeneralSecurityException
public static X509Certificate loadCertificate(InputStream in)
throws GeneralSecurityException
in - the input stream to read the certificate from.
X509Certificate the loaded certificate.
GeneralSecurityException - if certificate failed to load.
public static X509Certificate loadCertificate(String file)
throws IOException,
GeneralSecurityException
file - the certificate file to load the certificate from.
java.security.cert.X509Certificate
the loaded certificate.
IOException - if I/O error occurs
GeneralSecurityException - if security problems occurs.
public static X509Certificate[] loadCertificates(String file)
throws IOException,
GeneralSecurityException
file - the certificate file to load the certificate from.
java.security.cert.X509Certificate
the loaded certificate.
IOException - if I/O error occurs
GeneralSecurityException - if security problems occurs.public static String toGlobusID(String dn)
dn - the DN to convert to Globus format.
toGlobusID(String, boolean)
public static String toGlobusID(String dn,
boolean reverse)
dn - the DN to convert to Globus format.reverse - the direction of the conversion.
public static String toGlobusID(Principal name)
public static void installSecureRandomProvider()
public static KeyPair generateKeyPair(String algorithm,
int bits)
throws GeneralSecurityException
algorithm - the algorithm of the key pair.bits - the strength
KeyPair the generated key pair.
GeneralSecurityException - if something goes wrong.public static boolean isProxy(int certType)
certType - the certificate type to check.
public static boolean isGsi4Proxy(int certType)
certType - the certificate type to check.
public static boolean isGsi3Proxy(int certType)
certType - the certificate type to check.
public static boolean isGsi2Proxy(int certType)
certType - the certificate type to check.
public static boolean isLimitedProxy(int certType)
certType - the certificate type to check.
public static boolean isIndependentProxy(int certType)
certType - the certificate type to check.
public static boolean isImpersonationProxy(int certType)
certType - the certificate type to check.
public static String getProxyTypeAsString(int proxyType)
proxyType - the proxy type to get the string
description of.
public static boolean isGsi3Enabled()
public static X509CRL loadCrl(String file)
throws IOException,
GeneralSecurityException
IOException
GeneralSecurityException
public static X509CRL loadCrl(InputStream in)
throws GeneralSecurityException
GeneralSecurityException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||