Class X509Utils


  • public class X509Utils
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      X509Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getDisplayNameFromCertificate​(java.security.cert.X509Certificate certificate, boolean withLocation)
      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.
      static java.security.KeyStore loadKeyStore​(java.lang.String keystoreType, java.lang.String keystorePassword, java.io.InputStream is)
      Returns a key store loaded from the given stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • X509Utils

        public X509Utils()
    • Method Detail

      • getDisplayNameFromCertificate

        @Nullable
        public static java.lang.String getDisplayNameFromCertificate​(@Nonnull
                                                                     java.security.cert.X509Certificate certificate,
                                                                     boolean withLocation)
                                                              throws java.security.cert.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:
        java.security.cert.CertificateParsingException
      • loadKeyStore

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