gnu.crypto.keyring

Class PasswordEncryptedEntry

Implemented Interfaces:
PasswordProtectedEntry, Registry

public class PasswordEncryptedEntry
extends MaskableEnvelopeEntry
implements PasswordProtectedEntry, Registry

An envelope that is encrypted with a password-derived key.

Field Summary

static int
TYPE

Fields inherited from class gnu.crypto.keyring.MaskableEnvelopeEntry

masked

Fields inherited from class gnu.crypto.keyring.EnvelopeEntry

containingEnvelope, entries

Fields inherited from class gnu.crypto.keyring.Entry

payload, properties, type

Fields inherited from interface gnu.crypto.keyring.PasswordProtectedEntry

ITERATION_COUNT

Fields inherited from interface gnu.crypto.Registry

AES_CIPHER, ANUBIS_CIPHER, ARCFOUR_PRNG, BLOWFISH_CIPHER, CAST128_CIPHER, CAST5_CIPHER, CAST_128_CIPHER, CBC_MODE, CFB_MODE, CTR_MODE, DESEDE_CIPHER, DES_CIPHER, DH_KA, DH_KPG, DSA_KPG, DSA_SIG, DSS_KPG, DSS_SIG, ECB_MODE, ELGAMAL_KA, EME_PKCS1_V1_5_PAD, GKR_CERTIFICATES, GKR_CIPHER_AES_128_CBC, GKR_CIPHER_AES_128_OFB, GKR_HMAC_MD5_128, GKR_HMAC_MD5_96, GKR_HMAC_SHA_160, GKR_HMAC_SHA_96, GKR_MAGIC, GKR_PRIVATE_KEYS, GKR_PUBLIC_CREDENTIALS, GNU_CRYPTO, HAVAL_HASH, HMAC_NAME_PREFIX, ICM_MODE, ICM_PRNG, KHAZAD_CIPHER, MAGIC_RAW_DH_PRIVATE_KEY, MAGIC_RAW_DH_PUBLIC_KEY, MAGIC_RAW_DSS_PRIVATE_KEY, MAGIC_RAW_DSS_PUBLIC_KEY, MAGIC_RAW_DSS_SIGNATURE, MAGIC_RAW_RSA_PRIVATE_KEY, MAGIC_RAW_RSA_PSS_SIGNATURE, MAGIC_RAW_RSA_PUBLIC_KEY, MAGIC_RAW_SRP_PRIVATE_KEY, MAGIC_RAW_SRP_PUBLIC_KEY, MD2_HASH, MD4_HASH, MD5_HASH, MD_PRNG, NULL_CIPHER, OFB_MODE, PBKDF2_PRNG_PREFIX, PKCS7_PAD, QOP_AUTH, QOP_AUTH_CONF, QOP_AUTH_INT, RAW_ENCODING, RAW_ENCODING_ID, RC4_PRNG, REUSE_FALSE, REUSE_TRUE, RIJNDAEL_CIPHER, RIPEMD128_HASH, RIPEMD160_HASH, RIPEMD_128_HASH, RIPEMD_160_HASH, RSA_KPG, RSA_PKCS1_V1_5_SIG, RSA_PSS_SIG, SASL_ANONYMOUS_MECHANISM, SASL_AUTHORISATION_ID, SASL_AUTH_INFO_PROVIDER_PKGS, SASL_BUFFER_MAX_LIMIT, SASL_CALLBACK_HANDLER, SASL_CHANNEL_BINDING, SASL_CRAM_MD5_MECHANISM, SASL_FOUR_BYTE_MAX_LIMIT, SASL_HMAC_MD5_IALG, SASL_HMAC_SHA_IALG, SASL_ONE_BYTE_MAX_LIMIT, SASL_PASSWORD, SASL_PLAIN_MECHANISM, SASL_PREFIX, SASL_PROTOCOL, SASL_SERVER_NAME, SASL_SRP_MECHANISM, SASL_TWO_BYTE_MAX_LIMIT, SASL_USERNAME, SERPENT_CIPHER, SERVER_AUTH_FALSE, SERVER_AUTH_TRUE, SHA160_HASH, SHA1_HASH, SHA256_HASH, SHA384_HASH, SHA512_HASH, SHA_1_HASH, SHA_HASH, SQUARE_CIPHER, SRP6_KA, SRP_KPG, SRP_SASL_KA, SRP_TLS_KA, STRENGTH_HIGH, STRENGTH_LOW, STRENGTH_MEDIUM, TBC_PAD, TIGER_HASH, TMMH16, TRIPLEDES_CIPHER, TWOFISH_CIPHER, UHASH32, UMAC32, UMAC_PRNG, WHIRLPOOL_HASH

Constructor Summary

PasswordEncryptedEntry(String cipher, String mode, int keylen, Properties properties)

Method Summary

static PasswordEncryptedEntry
decode(DataInputStream in)
static PasswordEncryptedEntry
decode(DataInputStream in, char[] password)
void
decrypt(char[] password)
void
encode(DataOutputStream out, char[] password)
Encodes this entry, protected by a password.
protected void
encodePayload()
This method is called of subclasses when the payload data needs to be created.
void
encrypt(char[] password)

Methods inherited from class gnu.crypto.keyring.MaskableEnvelopeEntry

add, containsEntry, get, getEntries, isMasked, remove, remove, setMasked

Methods inherited from class gnu.crypto.keyring.EnvelopeEntry

add, containsAlias, containsEntry, decodeEnvelope, encodePayload, get, getAliasList, getEntries, remove, remove, setContainingEnvelope

Methods inherited from class gnu.crypto.keyring.Entry

defaultDecode, encode, encodePayload, getPayload, getProperties

Field Details

TYPE

public static final int TYPE

Field Value:
1

Constructor Details

PasswordEncryptedEntry

public PasswordEncryptedEntry(String cipher,
                              String mode,
                              int keylen,
                              Properties properties)

Method Details

decode

public static PasswordEncryptedEntry decode(DataInputStream in)
            throws IOException


decode

public static PasswordEncryptedEntry decode(DataInputStream in,
                                            char[] password)
            throws IOException


decrypt

public void decrypt(char[] password)
            throws IllegalArgumentException,
                   WrongPaddingException


encode

public void encode(DataOutputStream out,
                   char[] password)
            throws IOException
Encodes this entry, protected by a password.
Specified by:
encode in interface PasswordProtectedEntry

Parameters:
out - The output stream to encode to.
password - The password.


encodePayload

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


encrypt

public void encrypt(char[] password)
            throws IOException


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