Methods Summary |
---|
public final java.security.PrivateKey | generatePrivate(java.security.spec.KeySpec keySpec)Generates a instance of {@code PrivateKey} from the given key
specification.
return spiImpl.engineGeneratePrivate(keySpec);
|
public final java.security.PublicKey | generatePublic(java.security.spec.KeySpec keySpec)Generates a instance of {@code PublicKey} from the given key
specification.
return spiImpl.engineGeneratePublic(keySpec);
|
public final java.lang.String | getAlgorithm()Returns the name of the algorithm associated with this {@code KeyFactory}
.
return algorithm;
|
public static java.security.KeyFactory | getInstance(java.lang.String algorithm)Returns a new instance of {@code KeyFactory} that utilizes the specified
algorithm.
if (algorithm == null) {
throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, null);
return new KeyFactory((KeyFactorySpi)engine.spi, engine.provider, algorithm);
}
|
public static java.security.KeyFactory | getInstance(java.lang.String algorithm, java.lang.String provider)Returns a new instance of {@code KeyFactory} that utilizes the specified
algorithm from the specified provider.
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException(Messages.getString("security.02")); //$NON-NLS-1$
}
Provider p = Security.getProvider(provider);
if (p == null) {
throw new NoSuchProviderException(Messages.getString("security.03", provider)); //$NON-NLS-1$ //$NON-NLS-2$
}
return getInstance(algorithm, p);
|
public static java.security.KeyFactory | getInstance(java.lang.String algorithm, java.security.Provider provider)Returns a new instance of {@code KeyFactory} that utilizes the specified
algorithm from the specified provider.
if (provider == null) {
throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
}
if (algorithm == null) {
throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
return new KeyFactory((KeyFactorySpi)engine.spi, provider, algorithm);
}
|
public final T | getKeySpec(java.security.Key key, java.lang.Class keySpec)Returns the key specification for the specified key.
return spiImpl.engineGetKeySpec(key, keySpec);
|
public final java.security.Provider | getProvider()Returns the provider associated with this {@code KeyFactory}.
return provider;
|
public final java.security.Key | translateKey(java.security.Key key)Translates the given key into a key from this key factory.
return spiImpl.engineTranslateKey(key);
|