gnu.crypto.keyring

Class GnuPublicKeyring

Implemented Interfaces:
IKeyring, IPublicKeyring

public class GnuPublicKeyring
extends BaseKeyring
implements IPublicKeyring

Field Summary

static int
USAGE

Fields inherited from class gnu.crypto.keyring.BaseKeyring

keyring, keyring2

Fields inherited from interface gnu.crypto.keyring.IKeyring

KEYRING_DATA_IN, KEYRING_DATA_OUT, KEYRING_PASSWORD

Constructor Summary

GnuPublicKeyring()
GnuPublicKeyring(String mac, int macLen)

Method Summary

boolean
containsCertificate(String alias)
Tests if this keyring contains a certificate entry with the specified alias.
Certificate
getCertificate(String alias)
Returns a certificate that has the given alias, or null if this keyring has no such entry.
protected void
load(InputStream in, char[] password)
void
putCertificate(String alias, Certificate cert)
Adds a certificate in this keyring, with the given alias.

What happens if there is already a certificate entry with this alias?

protected void
store(OutputStream out, char[] password)

Methods inherited from class gnu.crypto.keyring.BaseKeyring

add, aliases, containsAlias, fixAlias, get, load, load, remove, reset, size, store, store

Field Details

USAGE

public static final int USAGE

Field Value:
1

Constructor Details

GnuPublicKeyring

public GnuPublicKeyring()


GnuPublicKeyring

public GnuPublicKeyring(String mac,
                        int macLen)

Method Details

containsCertificate

public boolean containsCertificate(String alias)
Tests if this keyring contains a certificate entry with the specified alias.
Specified by:
containsCertificate in interface IPublicKeyring

Parameters:
alias - The alias of the certificate to check.

Returns:
true if this keyring contains a certificate entry that has the given alias; false otherwise.


getCertificate

public Certificate getCertificate(String alias)
Returns a certificate that has the given alias, or null if this keyring has no such entry.
Specified by:
getCertificate in interface IPublicKeyring

Parameters:
alias - The alias of the certificate to find.

Returns:
The certificate with the designated alias, or null if none found.


load

protected void load(InputStream in,
                    char[] password)
            throws IOException
Overrides:
load in interface BaseKeyring


putCertificate

public void putCertificate(String alias,
                           Certificate cert)
Adds a certificate in this keyring, with the given alias.

What happens if there is already a certificate entry with this alias?

Specified by:
putCertificate in interface IPublicKeyring

Parameters:
alias - The alias of this certificate entry.
cert - The certificate.


store

protected void store(OutputStream out,
                     char[] password)
            throws IOException
Overrides:
store in interface BaseKeyring


Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.