javax.microedition.pki
Interface Certificate


public interface Certificate

Interface common to certificates. The features abstracted of Certificates include subject, issuer, type, version, serial number, signing algorithm, dates of valid use, and serial number.

Printable Representation for Binary Values

A non-string values in a certificate are represented as strings with each byte as two hex digits (capital letters for A-F) separated by ":" (Unicode 0x3A).

For example: 0C:56:FA:80

Printable Representation for X.509 Distinguished Names

For a X.509 certificate the value returned is the printable verision of the distingished name (DN) from the certificate.

An X.509 distinguished name of is set of attributes, each attribute is a sequence of an object ID and a value. For string comparison purposes, the following rules define a strict printable representation.

  1. There is no added white space around separators.
  2. Attributes are not reordered.
  3. If an object ID is in the table below, the label from the table will be substituted for the object ID, else the ID is formatted as a string using the binary printable representation above.
  4. Each object ID or label and value within an attribute will be separated by a "=" (Unicode 0x3D), even if the value is empty.
  5. If value is not a string, then it is formatted as a string using the binary printable representation above.
  6. Attributes will be separated by a ";" (Unicode 0x3B)

Labels for X.500 Distinguished Name Attributes
Object ID Binary Label
id-at-commonName 55:04:03 CN
id-at-surname 55:04:04 SN
id-at-countryName 55:04:06 C
id-at-localityName 55:04:07 L
id-at-stateOrProvinceName 55:04:08 ST
id-at-streetAddress 55:04:09 STREET
id-at-organizationName 55:04:0A O
id-at-organizationUnitName 55:04:0B OU
emailAddress 2A:86:48:86:F7:0D:01:09:01 EmailAddress

Example of a printable distinguished name:

C=US;O=Any Company, Inc.;CN=www.anycompany.com

Since:
MIDP 2.0

Method Summary
 String getIssuer()
          Gets the name of this certificate's issuer.
 long getNotAfter()
          Gets the time after which this Certificate may not be used from the validity period.
 long getNotBefore()
          Gets the time before which this Certificate may not be used from the validity period.
 String getSerialNumber()
          Gets the printable form of the serial number of this Certificate.
 String getSigAlgName()
          Gets the name of the algorithm used to sign the Certificate.
 String getSubject()
          Gets the name of this certificate's subject.
 String getType()
          Get the type of the Certificate.
 String getVersion()
          Gets the version number of this Certificate.
 

Method Detail

getIssuer

public String getIssuer()
Gets the name of this certificate's issuer.
Returns:
The issuer of the Certificate; the value MUST NOT be null.
Since:
JDE 4.0.0

getNotAfter

public long getNotAfter()
Gets the time after which this Certificate may not be used from the validity period.
Returns:
The time in milliseconds after which the Certificate is not valid (expiration date); it MUST be positive; Long.MAX_VALUE is returned if the certificate does not have its validity restricted based on the time.
Since:
JDE 4.0.0

getNotBefore

public long getNotBefore()
Gets the time before which this Certificate may not be used from the validity period.
Returns:
The time in milliseconds before which the Certificate is not valid; it MUST be positive, 0 is returned if the certificate does not have its validity restricted based on the time.
Since:
JDE 4.0.0

getSerialNumber

public String getSerialNumber()
Gets the printable form of the serial number of this Certificate. If the serial number within the certificate is binary it should be formatted as a string using the binary printable representation in class description. For example, 0C:56:FA:80.
Returns:
A string containing the serial number in user-friendly form; null is returned if there is no serial number.
Since:
JDE 4.0.0

getSigAlgName

public String getSigAlgName()
Gets the name of the algorithm used to sign the Certificate. The algorithm names returned should be the labels defined in RFC2459 Section 7.2.
Returns:
The name of signature algorithm; the value MUST NOT be null.
Since:
JDE 4.0.0

getSubject

public String getSubject()
Gets the name of this certificate's subject.
Returns:
The subject of this Certificate; the value MUST NOT be null.
Since:
JDE 4.0.0

getType

public String getType()
Get the type of the Certificate. For X.509 Certificates the value returned is "X.509".
Returns:
The type of the Certificate; the value MUST NOT be null.
Since:
JDE 4.0.0

getVersion

public String getVersion()
Gets the version number of this Certificate. The format of the version number depends on the specific type and specification. For a X.509 certificate per RFC 2459 it would be "3".
Returns:
The version number of the Certificate; the value MUST NOT be null.
Since:
JDE 4.0.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.