Android
java.security.cert
public abstract class

java.security.cert.Certificate

java.lang.Object
java.security.cert.Certificate Serializable

Abstract class to represent identity certificates. It represents a way to verify the binding of a Principal and its public key. Examples are X.509, PGP, and SDSI.

Nested Classes
Known Direct Subclasses

Summary

Protected Constructors

            Certificate(String type)

Public Methods

          boolean  equals(Object other)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
abstract          byte[]  getEncoded()
Returns the encoded representation for this certificate.
abstract          PublicKey  getPublicKey()
Returns the public key corresponding to this certificate.
    final      String  getType()
Returns the certificate type represented by the receiver.
          int  hashCode()
Returns an integer hash code for the receiver.
abstract          String  toString()
Returns a string containing a concise, human-readable description of the receiver.
abstract          void  verify(PublicKey key, String sigProvider)
Verifies that this certificate was signed with the given public key.
abstract          void  verify(PublicKey key)
Verifies that this certificate was signed with the given public key.

Protected Methods

          Object  writeReplace()
Methods inherited from class java.lang.Object

Details

Protected Constructors

protected Certificate(String type)

Public Methods

public boolean equals(Object other)

Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Parameters

other the object to compare with this object

Returns

  • true if the object is the same as this object false if it is different from this object

See Also

public abstract byte[] getEncoded()

Returns the encoded representation for this certificate.

Returns

  • the encoded representation for this certificate.

public abstract PublicKey getPublicKey()

Returns the public key corresponding to this certificate.

Returns

  • the public key corresponding to this certificate.

public final String getType()

Returns the certificate type represented by the receiver.

Returns

  • the certificate type represented by the receiver.

public int hashCode()

Returns an integer hash code for the receiver. Any two objects which answer true when passed to equals must answer the same value for this method.

Returns

  • the receiver's hash

See Also

public abstract String toString()

Returns a string containing a concise, human-readable description of the receiver.

Returns

  • a printable representation for the receiver.

public abstract void verify(PublicKey key, String sigProvider)

Verifies that this certificate was signed with the given public key. Uses the signature algorithm given by the provider.

Parameters

key PublicKey public key for which verification should be performed.
sigProvider String the name of the signature provider.

Throws

CertificateException if encoding errors are detected
NoSuchAlgorithmException if an unsupported algorithm is detected
InvalidKeyException if an invalid key is detected
NoSuchProviderException if there is no default provider
SignatureException if signature errors are detected

public abstract void verify(PublicKey key)

Verifies that this certificate was signed with the given public key.

Parameters

key PublicKey public key for which verification should be performed.

Throws

CertificateException if encoding errors are detected
NoSuchAlgorithmException if an unsupported algorithm is detected
InvalidKeyException if an invalid key is detected
NoSuchProviderException if there is no default provider
SignatureException if signature errors are detected

Protected Methods

protected Object writeReplace()

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48