public class X509Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertCsrAndCertMatch(org.bouncycastle.asn1.pkcs.CertificationRequest csr,
org.bouncycastle.asn1.x509.Certificate targetCert,
boolean caCertRequired) |
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(byte[][] certchain) |
static String |
encodeCertificates(X509Cert[] certchain) |
static String |
formatCert(X509Cert cert,
boolean verbose) |
static long |
fpCanonicalizedName(org.bouncycastle.asn1.x500.X500Name name) |
static org.bouncycastle.asn1.pkcs.Attribute |
getAttribute(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr,
org.bouncycastle.asn1.ASN1ObjectIdentifier type) |
static String |
getChallengePassword(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr) |
static String |
getCommonName(org.bouncycastle.asn1.x500.X500Name name) |
static byte[] |
getCoreExtValue(org.bouncycastle.asn1.x509.Extensions extensions,
org.bouncycastle.asn1.ASN1ObjectIdentifier extnType) |
static org.bouncycastle.asn1.x509.Extensions |
getExtensions(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr) |
static boolean |
issues(X509Cert issuerCert,
X509Cert cert) |
static List<X509Cert> |
listCertificates(String encodedCerts) |
static X509Cert |
parseCert(byte[] bytes) |
static X509Cert |
parseCert(File file) |
static X509Cert |
parseCert(InputStream certStream) |
static List<X509Cert> |
parseCerts(byte[] certsBytes) |
static List<X509Cert> |
parseCerts(InputStream certsStream) |
static List<X509Cert> |
parseCerts(List<org.xipki.util.FileOrBinary> certsConf) |
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) |
static String |
x500NameText(org.bouncycastle.asn1.x500.X500Name name) |
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 List<X509Cert> parseCerts(byte[] certsBytes) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic static List<X509Cert> parseCerts(InputStream certsStream) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic static X509Cert parseCert(InputStream certStream) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic static X509Cert parseCert(byte[] bytes) 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 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 x500NameText(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)
public static String encodeCertificates(X509Cert[] certchain) throws CertificateException, IOException
CertificateExceptionIOExceptionpublic static String encodeCertificates(byte[][] certchain)
public 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
BadInputExceptionpublic static org.bouncycastle.asn1.x509.Extensions getExtensions(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr)
public static String getChallengePassword(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr)
public static org.bouncycastle.asn1.pkcs.Attribute getAttribute(org.bouncycastle.asn1.pkcs.CertificationRequestInfo csr,
org.bouncycastle.asn1.ASN1ObjectIdentifier type)
public static List<X509Cert> parseCerts(List<org.xipki.util.FileOrBinary> certsConf) throws org.xipki.util.exception.InvalidConfException
org.xipki.util.exception.InvalidConfExceptionpublic static void assertCsrAndCertMatch(org.bouncycastle.asn1.pkcs.CertificationRequest csr,
org.bouncycastle.asn1.x509.Certificate targetCert,
boolean caCertRequired)
throws XiSecurityException
XiSecurityExceptionCopyright © 2023. All rights reserved.