java.security

Interface Certificate

public interface Certificate

This interface models a digital certificate which verifies the authenticity of a party. This class simply allows certificate information to be queried, it does not guarantee that the certificate is valid.

This class is deprecated in favor of the new java.security.cert package. It exists for backward compatibility only.

Since:
1.1

Method Summary

void
decode(InputStream in)
This method reads an encoded certificate from an InputStream.
void
encode(OutputStream out)
This method writes the certificate to an OutputStream in a format that can be understood by the decode method.
String
getFormat()
This method returns the encoding format of the certificate (e.g., "PGP", "X.509").
Principal
getGuarantor()
This method returns the Principal that is guaranteeing this certificate.
Principal
getPrincipal()
This method returns the Principal being guaranteed by this certificate.
PublicKey
getPublicKey()
This method returns the public key for the Principal that is being guaranteed.
String
toString(boolean detail)
This method returns a String representation of the contents of this certificate.

Method Details

decode

public void decode(InputStream in)
            throws KeyException,
                   IOException
This method reads an encoded certificate from an InputStream.
Parameters:
in - the InputStream to read from
Throws:
KeyException - if there is a problem with the certificate data
IOException - if an error occurs reading from the stream

encode

public void encode(OutputStream out)
            throws KeyException,
                   IOException
This method writes the certificate to an OutputStream in a format that can be understood by the decode method.
Parameters:
out - the OutputStream to write to
Throws:
KeyException - if there is a problem with the certificate
IOException - if an error occurs writing to the stream

getFormat

public String getFormat()
This method returns the encoding format of the certificate (e.g., "PGP", "X.509"). This format is used by the encode and decode methods.
Returns:
the encoding format being used

getGuarantor

public Principal getGuarantor()
This method returns the Principal that is guaranteeing this certificate.
Returns:
the Principal guaranteeing the certificate

getPrincipal

public Principal getPrincipal()
This method returns the Principal being guaranteed by this certificate.
Returns:
the Principal guaranteed by this certificate

getPublicKey

public PublicKey getPublicKey()
This method returns the public key for the Principal that is being guaranteed.
Returns:
the PublicKey of the Principal being guaranteed

toString

public String toString(boolean detail)
This method returns a String representation of the contents of this certificate.
Parameters:
detail - true to provided more detailed information
Returns:
the string representation

Certificate.java -- deprecated interface for modeling digital certificates Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.