public class X509Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static X509Cert[] |
buildCertPath(X509Cert targetCert,
Collection<X509Cert> certs)
Build the certificate path.
|
static X509Cert[] |
buildCertPath(X509Cert targetCert,
Collection<X509Cert> certs,
boolean includeTargetCert)
Build the certificate path.
|
static X509Cert[] |
buildCertPath(X509Cert targetCert,
Collection<X509Cert> certs,
Collection<X509Cert> trustAnchors,
boolean includeTargetCert) |
static String |
canonicalizName(org.bouncycastle.asn1.x500.X500Name name) |
static org.bouncycastle.asn1.x509.ExtendedKeyUsage |
createExtendedUsage(Collection<org.bouncycastle.asn1.ASN1ObjectIdentifier> usages) |
static org.bouncycastle.asn1.x509.Extension |
createExtnSubjectAltName(List<String> taggedValues,
boolean critical) |
static org.bouncycastle.asn1.x509.Extension |
createExtnSubjectInfoAccess(List<String> accessMethodAndLocations,
boolean critical) |
static org.bouncycastle.asn1.x509.KeyUsage |
createKeyUsage(Set<KeyUsage> usages) |
static String |
cutText(String text,
int maxLen) |
static String |
cutX500Name(org.bouncycastle.asn1.x500.X500Name name,
int maxLen) |
static String |
encodeCertificates(X509Cert[] certchain) |
static String |
formatCert(X509Cert cert,
boolean verbose) |
static long |
fpCanonicalizedName(org.bouncycastle.asn1.x500.X500Name name) |
static String |
getCommonName(org.bouncycastle.asn1.x500.X500Name name) |
static byte[] |
getCoreExtValue(org.bouncycastle.asn1.x509.Extensions extensions,
org.bouncycastle.asn1.ASN1ObjectIdentifier extnType) |
static String |
getRfc4519Name(org.bouncycastle.asn1.x500.X500Name name) |
static boolean |
issues(X509Cert issuerCert,
X509Cert cert) |
static List<X509Cert> |
listCertificates(String encodedCerts) |
static X509Cert |
parseCert(byte[] certBytes) |
static X509Cert |
parseCert(File file) |
static X509Cert |
parseCert(InputStream certStream) |
static org.bouncycastle.cert.X509CRLHolder |
parseCrl(byte[] encodedCrl) |
static org.bouncycastle.cert.X509CRLHolder |
parseCrl(File file) |
static org.bouncycastle.asn1.pkcs.CertificationRequest |
parseCsr(byte[] csrBytes) |
static org.bouncycastle.asn1.pkcs.CertificationRequest |
parseCsr(File file) |
static X509Certificate |
parseX509Certificate(InputStream crlStream) |
static String |
rdnValueToString(org.bouncycastle.asn1.ASN1Encodable value) |
static org.bouncycastle.asn1.x500.X500Name |
reverse(org.bouncycastle.asn1.x500.X500Name name) |
static byte[] |
toDerEncoded(byte[] bytes) |
static String |
toPemCert(X509Cert cert) |
static org.bouncycastle.asn1.x509.SubjectPublicKeyInfo |
toRfc3279Style(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo) |
public static String getCommonName(org.bouncycastle.asn1.x500.X500Name name)
public static org.bouncycastle.asn1.x500.X500Name reverse(org.bouncycastle.asn1.x500.X500Name name)
public static X509Cert parseCert(File file) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic static X509Cert parseCert(InputStream certStream) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic static X509Cert parseCert(byte[] certBytes) throws CertificateEncodingException
CertificateEncodingExceptionpublic static org.bouncycastle.asn1.pkcs.CertificationRequest parseCsr(File file) throws IOException
IOExceptionpublic static org.bouncycastle.asn1.pkcs.CertificationRequest parseCsr(byte[] csrBytes)
public static byte[] toDerEncoded(byte[] bytes)
public static String toPemCert(X509Cert cert) throws CertificateException
CertificateExceptionpublic static X509Certificate parseX509Certificate(InputStream crlStream) throws CertificateException
CertificateExceptionpublic static org.bouncycastle.cert.X509CRLHolder parseCrl(File file) throws IOException, CRLException
IOExceptionCRLExceptionpublic static org.bouncycastle.cert.X509CRLHolder parseCrl(byte[] encodedCrl)
throws CRLException
CRLExceptionpublic static String getRfc4519Name(org.bouncycastle.asn1.x500.X500Name name)
public static long fpCanonicalizedName(org.bouncycastle.asn1.x500.X500Name name)
public static String canonicalizName(org.bouncycastle.asn1.x500.X500Name name)
public static String rdnValueToString(org.bouncycastle.asn1.ASN1Encodable value)
public static org.bouncycastle.asn1.x509.KeyUsage createKeyUsage(Set<KeyUsage> usages)
public static org.bouncycastle.asn1.x509.ExtendedKeyUsage createExtendedUsage(Collection<org.bouncycastle.asn1.ASN1ObjectIdentifier> usages)
public static byte[] getCoreExtValue(org.bouncycastle.asn1.x509.Extensions extensions,
org.bouncycastle.asn1.ASN1ObjectIdentifier extnType)
public static X509Cert[] buildCertPath(X509Cert targetCert, Collection<X509Cert> certs) throws CertPathBuilderException
targetCert - certificate for which the certificate path will be builtcerts - collection of certificates.CertPathBuilderException - If cannot build a valid certificate path.public static X509Cert[] buildCertPath(X509Cert targetCert, Collection<X509Cert> certs, boolean includeTargetCert) throws CertPathBuilderException
targetCert - certificate for which the certificate path will be builtcerts - collection of certificates.includeTargetCert - whether to include targetCert in the result.CertPathBuilderException - If cannot build a valid certificate path.public static X509Cert[] buildCertPath(X509Cert targetCert, Collection<X509Cert> certs, Collection<X509Cert> trustAnchors, boolean includeTargetCert) throws CertPathBuilderException
CertPathBuilderExceptionpublic static String encodeCertificates(X509Cert[] certchain) throws CertificateException, IOException
CertificateExceptionIOExceptionpublic static List<X509Cert> listCertificates(String encodedCerts) throws CertificateException, IOException
CertificateExceptionIOExceptionpublic static boolean issues(X509Cert issuerCert, X509Cert cert) throws CertificateEncodingException
CertificateEncodingExceptionpublic static org.bouncycastle.asn1.x509.SubjectPublicKeyInfo toRfc3279Style(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
throws InvalidKeySpecException
InvalidKeySpecExceptionpublic static String cutX500Name(org.bouncycastle.asn1.x500.X500Name name, int maxLen)
public static org.bouncycastle.asn1.x509.Extension createExtnSubjectAltName(List<String> taggedValues, boolean critical) throws BadInputException
BadInputExceptionpublic static org.bouncycastle.asn1.x509.Extension createExtnSubjectInfoAccess(List<String> accessMethodAndLocations, boolean critical) throws BadInputException
BadInputExceptionCopyright © 2020. All rights reserved.