From ffde862e033a0825e1e9972a89c0f1f80b261a8e Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 14 Aug 2006 23:12:35 +0000 Subject: 2006-08-14 Mark Wielaard Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116139 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../gnu/javax/crypto/keyring/PublicKeyEntry.java | 62 ++++++---------------- 1 file changed, 16 insertions(+), 46 deletions(-) (limited to 'libjava/classpath/gnu/javax/crypto/keyring/PublicKeyEntry.java') diff --git a/libjava/classpath/gnu/javax/crypto/keyring/PublicKeyEntry.java b/libjava/classpath/gnu/javax/crypto/keyring/PublicKeyEntry.java index 528e70cc648..3e7f54d3e20 100644 --- a/libjava/classpath/gnu/javax/crypto/keyring/PublicKeyEntry.java +++ b/libjava/classpath/gnu/javax/crypto/keyring/PublicKeyEntry.java @@ -38,43 +38,30 @@ exception statement from your version. */ package gnu.javax.crypto.keyring; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import java.security.PublicKey; -import java.security.KeyFactory; -import java.security.spec.X509EncodedKeySpec; - -import java.util.Date; - import gnu.java.security.key.IKeyPairCodec; import gnu.java.security.key.KeyPairCodecFactory; import gnu.java.security.key.dss.DSSPublicKey; import gnu.java.security.key.rsa.GnuRSAPublicKey; import gnu.javax.crypto.key.dh.GnuDHPublicKey; -public final class PublicKeyEntry extends PrimitiveEntry -{ - - // Constants and fields. - // ------------------------------------------------------------------------ +import java.io.DataInputStream; +import java.io.IOException; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.Date; +public final class PublicKeyEntry + extends PrimitiveEntry +{ public static final int TYPE = 6; - private PublicKey key; - // Constructor. - // ------------------------------------------------------------------------ - public PublicKeyEntry(PublicKey key, Date creationDate, Properties properties) { super(TYPE, creationDate, properties); - if (key == null) - { - throw new IllegalArgumentException("no key specified"); - } + throw new IllegalArgumentException("no key specified"); this.key = key; } @@ -83,18 +70,13 @@ public final class PublicKeyEntry extends PrimitiveEntry super(TYPE); } - // Class method. - // ------------------------------------------------------------------------ - public static PublicKeyEntry decode(DataInputStream in) throws IOException { PublicKeyEntry entry = new PublicKeyEntry(); entry.defaultDecode(in); String type = entry.properties.get("type"); if (type == null) - { - throw new MalformedKeyringException("no key type"); - } + throw new MalformedKeyringException("no key type"); if (type.equalsIgnoreCase("RAW-DSS")) { IKeyPairCodec coder = KeyPairCodecFactory.getInstance("dss"); @@ -125,33 +107,23 @@ public final class PublicKeyEntry extends PrimitiveEntry try { KeyFactory kf = KeyFactory.getInstance("DSA"); - entry.key = kf.generatePublic(new X509EncodedKeySpec( - entry.payload)); + entry.key = kf.generatePublic(new X509EncodedKeySpec(entry.payload)); } catch (Exception x) { } if (entry.key == null) - { - throw new MalformedKeyringException( - "could not decode X.509 key"); - } + throw new MalformedKeyringException("could not decode X.509 key"); } } else - { - throw new MalformedKeyringException("unsupported public key type: " - + type); - } + throw new MalformedKeyringException("unsupported public key type: " + type); return entry; } - // Instance methods. - // ------------------------------------------------------------------------ - /** * Returns the public key. - * + * * @return The public key. */ public PublicKey getKey() @@ -185,8 +157,6 @@ public final class PublicKeyEntry extends PrimitiveEntry payload = key.getEncoded(); } else - { - throw new IllegalArgumentException("cannot encode public key"); - } + throw new IllegalArgumentException("cannot encode public key"); } } -- cgit v1.2.1