Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 488
نمايش فراداده

AlgorithmParametersjava.security

Java 1.2

This class is a generic, opaque representation of the parameters used by some cryptographic algorithm. You can create an instance of the class with one of the static getInstance( ) factory methods, specifying the desired algorithm and, optionally, the desired provider. The default "SUN" provider supports the "DSA" algorithm. The "SunJCE" provider shipped with the JCE supports "DES", "DESede", "PBE", "Blowfish", and "DiffieHellman". Once you have obtained an AlgorithmParameters object, initialize it by passing an algorithm-specific java.security.spec.AlgorithmParameterSpec object or the encoded parameter values as a byte array to the init( ) method. You can also create an AlgorithmParameters object with an AlgorithmParameterGenerator. getEncoded( ) returns the initialized algorithm parameters as a byte array, using either the algorithm-specific default encoding or the named encoding format you specified.

public class

AlgorithmParameters { // Protected Constructors protected

AlgorithmParameters (AlgorithmParametersSpi

paramSpi , Provider

provider , String

algorithm ); // Public Class Methods public static AlgorithmParameters

getInstance (String

algorithm ) throws NoSuchAlgorithmException; public static AlgorithmParameters

getInstance (String

algorithm , String

provider ) throws NoSuchAlgorithmException, NoSuchProviderException;

1.4 public static AlgorithmParameters

getInstance (String

algorithm , Provider

provider ) throws NoSuchAlgorithmException; // Public Instance Methods public final String

getAlgorithm ( ); public final byte[ ]

getEncoded ( ) throws java.io.IOException; public final byte[ ]

getEncoded (String

format ) throws java.io.IOException; public final <T extends java.security.spec.AlgorithmParameterSpec> T

getParameterSpec (Class<T>

paramSpec ) throws java.security.spec. InvalidParameterSpecException; public final Provider

getProvider ( ); public final void

init (java.security.spec.AlgorithmParameterSpec

paramSpec ) throws java.security.spec.InvalidParameterSpecException; public final void

init (byte[ ]

params ) throws java.io.IOException; public final void

init (byte[ ]

params , String

format ) throws java.io.IOException; // Public Methods Overriding Object public final String

toString ( ); }

Passed To

javax.crypto.Cipher.init( ), javax.crypto.CipherSpi.engineInit( ), javax.crypto.EncryptedPrivateKeyInfo.EncryptedPrivateKeyInfo( ), javax.crypto.ExemptionMechanism.init( ), javax.crypto.ExemptionMechanismSpi.engineInit( )

Returned By

AlgorithmParameterGenerator.generateParameters( ), AlgorithmParameterGeneratorSpi.engineGenerateParameters( ), Signature.getParameters( ), SignatureSpi.engineGetParameters( ), javax.crypto.Cipher.getParameters( ), javax.crypto.CipherSpi.engineGetParameters( ), javax.crypto.EncryptedPrivateKeyInfo.getAlgParameters( )