Package org.bouncycastle.jce
Class PrincipalUtil
java.lang.Object
org.bouncycastle.jce.PrincipalUtil
public class PrincipalUtil extends Object
a utility class that will extract X509Principal objects from X.509 certificates.
Use this in preference to trying to recreate a principal from a String, not all DNs are what they should be, so it's best to leave them encoded where they can be.
-
Constructor Summary
Constructors Constructor Description PrincipalUtil() -
Method Summary
Modifier and Type Method Description static X509PrincipalgetIssuerX509Principal(X509Certificate cert)return the issuer of the given cert as an X509PrincipalObject.static X509PrincipalgetIssuerX509Principal(X509CRL crl)return the issuer of the given CRL as an X509PrincipalObject.static X509PrincipalgetSubjectX509Principal(X509Certificate cert)return the subject of the given cert as an X509PrincipalObject.
-
Constructor Details
-
PrincipalUtil
public PrincipalUtil()
-
-
Method Details
-
getIssuerX509Principal
public static X509Principal getIssuerX509Principal(X509Certificate cert) throws CertificateEncodingExceptionreturn the issuer of the given cert as an X509PrincipalObject.- Throws:
CertificateEncodingException
-
getSubjectX509Principal
public static X509Principal getSubjectX509Principal(X509Certificate cert) throws CertificateEncodingExceptionreturn the subject of the given cert as an X509PrincipalObject.- Throws:
CertificateEncodingException
-
getIssuerX509Principal
return the issuer of the given CRL as an X509PrincipalObject.- Throws:
CRLException
-