Package org.bitcoinj.crypto
Class X509Utils
- java.lang.Object
-
- org.bitcoinj.crypto.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, seePaymentSession
, 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.
-
-
-
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
-
-