diff options
author | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-07-01 22:48:38 +0000 |
---|---|---|
committer | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-07-01 22:48:38 +0000 |
commit | 62f65026d3314142ba01b6c7571a4b10f88268a7 (patch) | |
tree | 1b213e15189b8930ff3183758e4a63097da662d8 /gnu/javax/crypto/keyring/PrimitiveEntry.java | |
parent | 6116fe2306c65520801cd6e1bd6a701267b1c378 (diff) | |
download | classpath-62f65026d3314142ba01b6c7571a4b10f88268a7.tar.gz |
2006-07-02 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/javax/crypto/keyring/AuthenticatedEntry.java: Source formatting.
* gnu/javax/crypto/keyring/BaseKeyring.java: Likewise.
* gnu/javax/crypto/keyring/BinaryDataEntry.java: Likewise.
* gnu/javax/crypto/keyring/CertificateEntry.java: Likewise.
* gnu/javax/crypto/keyring/CertPathEntry.java: Likewise.
* gnu/javax/crypto/keyring/CompressedEntry.java: Likewise.
* gnu/javax/crypto/keyring/EncryptedEntry.java: Likewise.
* gnu/javax/crypto/keyring/Entry.java: Likewise.
* gnu/javax/crypto/keyring/EnvelopeEntry.java: Likewise.
* gnu/javax/crypto/keyring/GnuPrivateKeyring.java: Likewise.
* gnu/javax/crypto/keyring/GnuPublicKeyring.java: Likewise.
* gnu/javax/crypto/keyring/IKeyring.java: Likewise.
* gnu/javax/crypto/keyring/IPrivateKeyring.java: Likewise.
* gnu/javax/crypto/keyring/IPublicKeyring.java: Likewise.
* gnu/javax/crypto/keyring/MalformedKeyringException.java: Likewise.
* gnu/javax/crypto/keyring/MaskableEnvelopeEntry.java: Likewise.
* gnu/javax/crypto/keyring/MeteredInputStream.java: Likewise.
* gnu/javax/crypto/keyring/PasswordAuthenticatedEntry.java: Likewise.
* gnu/javax/crypto/keyring/PasswordEncryptedEntry.java: Likewise.
* gnu/javax/crypto/keyring/PasswordProtectedEntry.java: Likewise.
* gnu/javax/crypto/keyring/PrimitiveEntry.java: Likewise.
* gnu/javax/crypto/keyring/PrivateKeyEntry.java: Likewise.
* gnu/javax/crypto/keyring/Properties.java: Likewise.
* gnu/javax/crypto/keyring/PublicKeyEntry.java: Likewise.
Diffstat (limited to 'gnu/javax/crypto/keyring/PrimitiveEntry.java')
-rw-r--r-- | gnu/javax/crypto/keyring/PrimitiveEntry.java | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/gnu/javax/crypto/keyring/PrimitiveEntry.java b/gnu/javax/crypto/keyring/PrimitiveEntry.java index f5e63e996..194fe9eee 100644 --- a/gnu/javax/crypto/keyring/PrimitiveEntry.java +++ b/gnu/javax/crypto/keyring/PrimitiveEntry.java @@ -43,35 +43,24 @@ import java.util.Date; /** * A primitive entry is an entry that contains a single cryptographic entity. */ -public abstract class PrimitiveEntry extends Entry +public abstract class PrimitiveEntry + extends Entry { - - // Fields. - // ------------------------------------------------------------------------ - /** The creation date. */ protected Date creationDate; - // Constructor. - // ------------------------------------------------------------------------ - protected PrimitiveEntry(int type, Date creationDate, Properties properties) { super(type, properties); if (creationDate == null) - { - this.creationDate = new Date(); - } + this.creationDate = new Date(); else - { - this.creationDate = (Date) creationDate.clone(); - } - if (!this.properties.containsKey("alias") + this.creationDate = (Date) creationDate.clone(); + if (! this.properties.containsKey("alias") || this.properties.get("alias").length() == 0) - { - throw new IllegalArgumentException("primitive entries MUST have an alias"); - } - this.properties.put("creation-date", String.valueOf(this.creationDate.getTime())); + throw new IllegalArgumentException("primitive entries MUST have an alias"); + this.properties.put("creation-date", + String.valueOf(this.creationDate.getTime())); } protected PrimitiveEntry(int type) @@ -79,12 +68,9 @@ public abstract class PrimitiveEntry extends Entry super(type); } - // Instance method. - // ------------------------------------------------------------------------ - /** * Returns the alias of this primitive entry. - * + * * @return The alias. */ public String getAlias() @@ -94,7 +80,7 @@ public abstract class PrimitiveEntry extends Entry /** * Returns the creation date of this primitive entry. - * + * * @return The creation date. */ public Date getCreationDate() @@ -104,7 +90,7 @@ public abstract class PrimitiveEntry extends Entry public boolean equals(Object object) { - if (!getClass().equals(object.getClass())) + if (! getClass().equals(object.getClass())) return false; return getAlias().equals(((PrimitiveEntry) object).getAlias()); } @@ -113,9 +99,7 @@ public abstract class PrimitiveEntry extends Entry { String s = properties.get("creation-date"); if (s == null) - { - throw new MalformedKeyringException("no creation date"); - } + throw new MalformedKeyringException("no creation date"); try { creationDate = new Date(Long.parseLong(s)); |