From b0fc58713dc5c60f3a0bbe792124c37eb97d5d5a Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 17 Nov 2002 00:10:24 +0000 Subject: Integrate work by Raif S. Integrate work by Raif S. Naffah (raif@fl.net.au) * java/security/DummyKeyPairGenerator.java (clone): New method. * java/security/DummyMessageDigest.java (clone): New method. (engineUpdate): Now public. (engineReset): Likewise. (engineDigest): Likewise. (engineGetDigestLength): New method. * java/security/DummySignature.java (clone): New method. * java/security/KeyPairGenerator.java (provider): Now package private. (getInstance(String)): Use getInstance(String,Provider). (getInstance(String,String): Use getInstance(String,Provider) (getInstance(String,Provider): New method. (getInstance(String,String,Provider): Don't cast DummyKeyPairGenerator. * java/security/KeyPairGeneratorSpi.java (clone): New method. * java/security/MessageDigest.java (provider): Now package private. (getInstance(String): Use getInstance(String,Provider). (getInstance(String,String): Use getInstance(String,Provider) (getInstance(String,Provider): New method. * java/security/Provider.java (toCanonicalKey): New method. (get): New method that uses toCanonicalKey(). (put): Use toCanonicalKey(). (remove): Likewise. * java/security/Security.java (insertProviderAt): Provider index is one based, not zero based. (addProvider): Likewise. (removeProvider): Likewise. * java/security/Signature.java (provider): Now package private. (getInstance(String)): Use getInstance(String,Provider). (getInstance(String,String): Use getInstance(String,Provider) (getInstance(String,Provider): New method. (getInstance(String,String,Provider): Don't cast DummySignature. From-SVN: r59179 --- libjava/java/security/KeyPairGeneratorSpi.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libjava/java/security/KeyPairGeneratorSpi.java') diff --git a/libjava/java/security/KeyPairGeneratorSpi.java b/libjava/java/security/KeyPairGeneratorSpi.java index 9e929e0..735dd64 100644 --- a/libjava/java/security/KeyPairGeneratorSpi.java +++ b/libjava/java/security/KeyPairGeneratorSpi.java @@ -1,5 +1,5 @@ /* KeyPairGeneratorSpi.java --- Key Pair Generator SPI Class - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -90,4 +90,20 @@ public abstract class KeyPairGeneratorSpi @return a key pair */ public abstract KeyPair generateKeyPair(); + + /** + Returns a clone of this class. + + If cloning is not supported, then by default the class throws a + CloneNotSupportedException. The MessageDigestSpi provider + implementation has to overload this class in order to be + cloneable. + */ + public Object clone() throws CloneNotSupportedException + { + if (this instanceof Cloneable) + return super.clone(); + else + throw new CloneNotSupportedException(); + } } -- cgit v1.1