Class X509Utils

java.lang.Object
org.bitcoinj.crypto.X509Utils

public class X509Utils extends Object
X509Utils provides tools for working with X.509 certificates and keystores, as used in the BIP 70 payment protocol. For more details on this, see PaymentSession, the article "Working with the payment protocol" on the bitcoinj website, or the Bitcoin developer guide.
  • Constructor Details

    • X509Utils

      public X509Utils()
  • Method Details

    • getDisplayNameFromCertificate

      @Nullable public static String getDisplayNameFromCertificate(@Nonnull X509Certificate certificate, boolean withLocation) throws CertificateParsingException
      Returns either a string that "sums up" the certificate for humans, in a similar manner to what you might see in a web browser, or null if one cannot be extracted. This will typically be the common name (CN) field, but can also be the org (O) field, org+location+country if withLocation is set, or the email address for S/MIME certificates.
      Throws:
      CertificateParsingException
    • loadKeyStore

      public static KeyStore loadKeyStore(String keystoreType, @Nullable String keystorePassword, InputStream is) throws KeyStoreException
      Returns a key store loaded from the given stream. Just a convenience around the Java APIs.
      Throws:
      KeyStoreException