gnu.crypto.keyring

Class EnvelopeEntry

Known Direct Subclasses:
CompressedEntry, MaskableEnvelopeEntry

public abstract class EnvelopeEntry
extends Entry

An envelope entry is a generic container for some number of primitive and other envelope entries.

Field Summary

protected EnvelopeEntry
containingEnvelope
The envelope that contains this one (if any).
protected List
entries
The contained entries.

Fields inherited from class gnu.crypto.keyring.Entry

payload, properties, type

Constructor Summary

EnvelopeEntry(int type)
Constructor for use by subclasses.
EnvelopeEntry(int type, Properties properties)
Creates a new Entry.

Method Summary

void
add(Entry entry)
Adds an entry to this envelope.
boolean
containsAlias(String alias)
Tests if this envelope contains a primitive entry with the given alias.
boolean
containsEntry(Entry entry)
Tests if this envelope contains the given entry.
protected void
decodeEnvelope(DataInputStream in)
protected void
encodePayload()
This method is called of subclasses when the payload data needs to be created.
List
get(String alias)
Gets all primitive entries that have the given alias.
String
getAliasList()
Returns the list of all aliases contained by this envelope, separated by a semicolon (';').
List
getEntries()
Returns a copy of all entries this envelope contains.
void
remove(String alias)
Removes all primitive entries that have the specified alias.
boolean
remove(Entry entry)
Removes the specified entry.
protected void
setContainingEnvelope(EnvelopeEntry e)

Methods inherited from class gnu.crypto.keyring.Entry

defaultDecode, encode, encodePayload, getPayload, getProperties

Field Details

containingEnvelope

protected EnvelopeEntry containingEnvelope
The envelope that contains this one (if any).

entries

protected List entries
The contained entries.

Constructor Details

EnvelopeEntry

protected EnvelopeEntry(int type)
Constructor for use by subclasses.

EnvelopeEntry

public EnvelopeEntry(int type,
                     Properties properties)
Creates a new Entry.
Parameters:
type - This entry's type.
properties - This entry's properties.

Method Details

add

public void add(Entry entry)
Adds an entry to this envelope.
Parameters:
entry - The entry to add.

containsAlias

public boolean containsAlias(String alias)
Tests if this envelope contains a primitive entry with the given alias.
Parameters:
alias - The alias to test.
Returns:
True if this envelope (or one of the contained envelopes) contains a primitive entry with the given alias.

containsEntry

public boolean containsEntry(Entry entry)
Tests if this envelope contains the given entry.
Parameters:
entry - The entry to test.
Returns:
True if this envelope contains the given entry.

decodeEnvelope

protected void decodeEnvelope(DataInputStream in)
            throws IOException

encodePayload

protected void encodePayload()
            throws IOException
This method is called of subclasses when the payload data needs to be created.
Overrides:
encodePayload in interface Entry

get

public List get(String alias)
Gets all primitive entries that have the given alias. If there are any masked entries that contain the given alias, they will be returned as well.
Parameters:
alias - The alias of the entries to get.
Returns:
A list of all primitive entries that have the given alias.

getAliasList

public String getAliasList()
Returns the list of all aliases contained by this envelope, separated by a semicolon (';').
Returns:
The list of aliases.

getEntries

public List getEntries()
Returns a copy of all entries this envelope contains.
Returns:
All contained entries.

remove

public void remove(String alias)
Removes all primitive entries that have the specified alias.
Parameters:
alias - The alias of the entries to remove.

remove

public boolean remove(Entry entry)
Removes the specified entry.
Parameters:
entry - The entry.
Returns:
True if an entry was removed.

setContainingEnvelope

protected void setContainingEnvelope(EnvelopeEntry e)

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