gnu.crypto.keyring

Class AuthenticatedEntry

public final class AuthenticatedEntry extends MaskableEnvelopeEntry implements Registry

Field Summary
static intTYPE
Constructor Summary
AuthenticatedEntry(String mac, int macLen, Properties properties)
Method Summary
voidauthenticate(byte[] key)
Computes the mac over this envelope's data.
static AuthenticatedEntrydecode(DataInputStream in)
protected voidencodePayload()
voidverify(byte[] key)
Verifies this entry's payload.

Field Detail

TYPE

public static final int TYPE

Constructor Detail

AuthenticatedEntry

public AuthenticatedEntry(String mac, int macLen, Properties properties)

Method Detail

authenticate

public void authenticate(byte[] key)
Computes the mac over this envelope's data. This method must be called before this entry in encoded.

Parameters: key The key to authenticate with.

Throws: IOException If encoding fails. InvalidKeyException If the supplied key is bad.

decode

public static AuthenticatedEntry decode(DataInputStream in)

encodePayload

protected void encodePayload()

verify

public void verify(byte[] key)
Verifies this entry's payload. This method will unmask this entry, thus it must be called before accessing its contents.

Parameters: key The key to use to authenticate.

Throws: InvalidKeyException If the given key is improper.

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