Skip to content

Most visited

Recently visited

navigation
Added in API level 1

SslCertificate

public class SslCertificate
extends Object

java.lang.Object
   ↳ android.net.http.SslCertificate


SSL certificate info (certificate details) class

Summary

Nested classes

class SslCertificate.DName

A distinguished name helper class: a 3-tuple of:

  • the most specific common name (CN)
  • the most specific organization (O)
  • the most specific organizational unit (OU)
    •  

Public constructors

SslCertificate(String issuedTo, String issuedBy, String validNotBefore, String validNotAfter)

This constructor was deprecated in API level 8. Use SslCertificate(X509Certificate)

SslCertificate(String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter)

This constructor was deprecated in API level 12. Use SslCertificate(X509Certificate)

SslCertificate(X509Certificate certificate)

Creates a new SSL certificate object from an X509 certificate

Public methods

SslCertificate.DName getIssuedBy()
SslCertificate.DName getIssuedTo()
String getValidNotAfter()

This method was deprecated in API level 8. Use getValidNotAfterDate()

Date getValidNotAfterDate()
String getValidNotBefore()

This method was deprecated in API level 8. Use getValidNotBeforeDate()

Date getValidNotBeforeDate()
static SslCertificate restoreState(Bundle bundle)

Restores the certificate stored in the bundle

static Bundle saveState(SslCertificate certificate)

Saves the certificate state to a bundle

String toString()

Returns a string containing a concise, human-readable description of this object.

Inherited methods

From class java.lang.Object

Public constructors

SslCertificate

Added in API level 1
SslCertificate (String issuedTo, 
                String issuedBy, 
                String validNotBefore, 
                String validNotAfter)

This constructor was deprecated in API level 8.
Use SslCertificate(X509Certificate)

Creates a new SSL certificate object

Parameters
issuedTo String: The entity this certificate is issued to
issuedBy String: The entity that issued this certificate
validNotBefore String: The not-before date from the certificate validity period in ISO 8601 format
validNotAfter String: The not-after date from the certificate validity period in ISO 8601 format

SslCertificate

Added in API level 8
SslCertificate (String issuedTo, 
                String issuedBy, 
                Date validNotBefore, 
                Date validNotAfter)

This constructor was deprecated in API level 12.
Use SslCertificate(X509Certificate)

Creates a new SSL certificate object

Parameters
issuedTo String: The entity this certificate is issued to
issuedBy String: The entity that issued this certificate
validNotBefore Date: The not-before date from the certificate validity period
validNotAfter Date: The not-after date from the certificate validity period

SslCertificate

Added in API level 1
SslCertificate (X509Certificate certificate)

Creates a new SSL certificate object from an X509 certificate

Parameters
certificate X509Certificate: X509 certificate

Public methods

getIssuedBy

Added in API level 1
SslCertificate.DName getIssuedBy ()

Returns
SslCertificate.DName Issued-by distinguished name or null if none has been set

getIssuedTo

Added in API level 1
SslCertificate.DName getIssuedTo ()

Returns
SslCertificate.DName Issued-to distinguished name or null if none has been set

getValidNotAfter

Added in API level 1
String getValidNotAfter ()

This method was deprecated in API level 8.
Use getValidNotAfterDate()

Returns
String Not-after date from the certificate validity period in ISO 8601 format or "" if none has been set

getValidNotAfterDate

Added in API level 8
Date getValidNotAfterDate ()

Returns
Date Not-after date from the certificate validity period or "" if none has been set

getValidNotBefore

Added in API level 1
String getValidNotBefore ()

This method was deprecated in API level 8.
Use getValidNotBeforeDate()

Returns
String Not-before date from the certificate validity period in ISO 8601 format or "" if none has been set

getValidNotBeforeDate

Added in API level 8
Date getValidNotBeforeDate ()

Returns
Date Not-before date from the certificate validity period or "" if none has been set

restoreState

Added in API level 1
SslCertificate restoreState (Bundle bundle)

Restores the certificate stored in the bundle

Parameters
bundle Bundle: The bundle with the certificate state stored in it
Returns
SslCertificate The SSL certificate stored in the bundle or null if fails

saveState

Added in API level 1
Bundle saveState (SslCertificate certificate)

Saves the certificate state to a bundle

Parameters
certificate SslCertificate: The SSL certificate to store
Returns
Bundle A bundle with the certificate stored in it or null if fails

toString

Added in API level 1
String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
String A string representation of this certificate for debugging
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.