aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java')
-rw-r--r--libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java89
1 files changed, 0 insertions, 89 deletions
diff --git a/libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java b/libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java
deleted file mode 100644
index 320aac3f8..000000000
--- a/libraries/spongycastle/core/src/main/jdk1.1/java/security/KeyFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-
-package java.security;
-
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-
-public class KeyFactory extends Object
-{
- private KeyFactorySpi keyFacSpi;
- private Provider provider;
- private String algorithm;
-
- protected KeyFactory(
- KeyFactorySpi keyFacSpi,
- Provider provider,
- String algorithm)
- {
- this.keyFacSpi = keyFacSpi;
- this.provider = provider;
- this.algorithm = algorithm;
- }
-
- public final PrivateKey generatePrivate(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGeneratePrivate(keySpec);
- }
-
- public final PublicKey generatePublic(KeySpec keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGeneratePublic(keySpec);
- }
-
- public final String getAlgorithm()
- {
- return algorithm;
- }
-
- public static KeyFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
- {
- try
- {
- SecurityUtil.Implementation imp = SecurityUtil.getImplementation("KeyFactory", algorithm, null);
-
- if (imp != null)
- {
- return new KeyFactory((KeyFactorySpi)imp.getEngine(), imp.getProvider(), algorithm);
- }
-
- throw new NoSuchAlgorithmException("can't find algorithm " + algorithm);
- }
- catch (NoSuchProviderException e)
- {
- throw new NoSuchAlgorithmException(algorithm + " not found");
- }
- }
-
- public static KeyFactory getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
- {
- SecurityUtil.Implementation imp = SecurityUtil.getImplementation("KeyFactory", algorithm, null);
-
- if (imp != null)
- {
- return new KeyFactory((KeyFactorySpi)imp.getEngine(), imp.getProvider(), algorithm);
- }
-
- throw new NoSuchAlgorithmException("can't find algorithm " + algorithm);
- }
-
- public final KeySpec getKeySpec(Key key, Class keySpec)
- throws InvalidKeySpecException
- {
- return keyFacSpi.engineGetKeySpec(key, keySpec);
- }
-
- public final Provider getProvider()
- {
- return provider;
- }
-
- public final Key translateKey(Key key)
- throws InvalidKeyException
- {
- return keyFacSpi.engineTranslateKey(key);
- }
-}