public class

SslCertificate

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

Class Overview

SSL certificate info (certificate details) class

Summary

Nested Classes
class SslCertificate.DName A distinguished name helper class: a 3-tuple of: - common name (CN), - organization (O), - organizational unit (OU)  
Public Constructors
SslCertificate(String issuedTo, String issuedBy, String validNotBefore, String validNotAfter)
This constructor is deprecated. Use SslCertificate(String, String, Date, Date)
SslCertificate(String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter)
Creates a new SSL certificate object
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 is deprecated. Use getValidNotAfterDate()
Date getValidNotAfterDate()
String getValidNotBefore()
This method is deprecated. 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

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

Since: API Level 1

This constructor is deprecated.
Use SslCertificate(String, String, Date, Date)

Creates a new SSL certificate object

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

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

Since: API Level 8

Creates a new SSL certificate object

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

public SslCertificate (X509Certificate certificate)

Since: API Level 1

Creates a new SSL certificate object from an X509 certificate

Parameters
certificate X509 certificate

Public Methods

public SslCertificate.DName getIssuedBy ()

Since: API Level 1

Returns
  • Issued-by distinguished name or null if none has been set

public SslCertificate.DName getIssuedTo ()

Since: API Level 1

Returns
  • Issued-to distinguished name or null if none has been set

public String getValidNotAfter ()

Since: API Level 1

This method is deprecated.
Use getValidNotAfterDate()

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

public Date getValidNotAfterDate ()

Since: API Level 8

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

public String getValidNotBefore ()

Since: API Level 1

This method is deprecated.
Use getValidNotBeforeDate()

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

public Date getValidNotBeforeDate ()

Since: API Level 8

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

public static SslCertificate restoreState (Bundle bundle)

Since: API Level 1

Restores the certificate stored in the bundle

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

public static Bundle saveState (SslCertificate certificate)

Since: API Level 1

Saves the certificate state to a bundle

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

public String toString ()

Since: API Level 1

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
  • A string representation of this certificate for debugging