Methods Summary |
---|
public final javax.crypto.SecretKey | generateSecret(java.security.spec.KeySpec keySpec)Generate a secret key from the specified key specification.
return spiImpl.engineGenerateSecret(keySpec);
|
public final java.lang.String | getAlgorithm()Returns the name of the secret key algorithm.
return algorithm;
|
public static final javax.crypto.SecretKeyFactory | getInstance(java.lang.String algorithm)Creates a new {@code SecretKeyFactory} instance for the specified key
algorithm.
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, null);
return new SecretKeyFactory((SecretKeyFactorySpi) engine.spi,
engine.provider, algorithm);
}
|
public static final javax.crypto.SecretKeyFactory | getInstance(java.lang.String algorithm, java.lang.String provider)Creates a new {@code SecretKeyFactory} instance for the specified key
algorithm from the specified {@code provider}.
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
}
Provider impProvider = Security.getProvider(provider);
if (impProvider == null) {
throw new NoSuchProviderException(provider);
}
return getInstance(algorithm, impProvider);
|
public static final javax.crypto.SecretKeyFactory | getInstance(java.lang.String algorithm, java.security.Provider provider)Creates a new {@code SecretKeyFactory} instance for the specified key
algorithm from the specified provider.
if (provider == null) {
throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
}
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
return new SecretKeyFactory((SecretKeyFactorySpi) engine.spi, provider,
algorithm);
}
|
public final java.security.spec.KeySpec | getKeySpec(javax.crypto.SecretKey key, java.lang.Class keySpec)Returns the key specification of the specified secret key.
return spiImpl.engineGetKeySpec(key, keySpec);
|
public final java.security.Provider | getProvider()Returns the provider for this {@code SecretKeyFactory} instance.
return provider;
|
public final javax.crypto.SecretKey | translateKey(javax.crypto.SecretKey key)Translates the specified secret key into an instance of the corresponding
key from the provider of this key factory.
return spiImpl.engineTranslateKey(key);
|