start page | rating of books | rating of authors | reviews | copyrights

Book Home Java Security Search this book

D.4. Package java.security.spec

Interface java.security.spec.AlgorithmParameterSpec

Algorithm parameter specifications are used to import and export keys via a key factory. This interface is used strictly for type identification; the specifics of the parameters are left to the implementing class.

Interface Definition

public interface java.security.spec.AlgorithmParameterSpec {
}

See also: DSAParameterSpec, KeyFactory

a name="INDE
Class java.security.spec.DSAParameterSpec

This class provides the basis for DSA key generation via parameters; it encapsulates the three parameters that are common to DSA algorithms.

Class Definition

public class java.security.spec.DSAParameterSpec
	extends java.lang.Object
	implements java.security.spec.AlgorithmParameterSpec,
			 java.security.interfaces.DSAParams {

	// Constructors
	public DSAParameterSpec(BigInteger, BigInteger, BigInteger);

	// Instance Methods
	public BigInteger getG();
	public BigInteger getP();
	public BigInteger getQ();
}

See also: AlgorithmParameterSpec, DSAParams, DSAPrivateKeySpec, DSAPublicKeySpec

Class java.security.spec.DSAPrivateKeySpec

This class provides the ability to calculate a DSA private key based upon the four parameters that comprise the key.

Class Definition

public class java.security.spec.DSAPrivateKeySpec
	extends java.lang.Object
	implements java.security.spec.KeySpec {

	// Constructors
	public DSAPrivateKeySpec(BigInteger, BigInteger,
								BigInteger, BigInteger);

	// Instance Methods
	public BigInteger getG();
	public BigInteger getP();
	public BigInteger getQ();
	public BigInteger getX();
}

See also: DSAPublicKeySpec, KeyFactory

Class java.security.spec.DSAPublicKeySpec

This class provides the ability to calculate a DSA public key based upon the four parameters that comprise the key.

Class Definition

public class java.security.spec.DSAPublicKeySpec
	extends java.lang.Object
	implements java.security.spec.KeySpec {

	// Constructors
	public DSAPublicKeySpec(BigInteger, BigInteger,
								BigInteger, BigInteger);

	// Instance Methods
	public BigInteger getG();
	public BigInteger getP();
	public BigInteger getQ();
	public BigInteger getY();
}

See also: DSAPrivateKeySpec, KeyFactory

Class java.security.spec.EncodedKeySpec

This class is used to translate between keys and their external encoded format. The encoded format is always simply a series of bytes, but the format of the encoding of the key information into those bytes may vary depending upon the algorithm used to generate the key.

Class Definition

public abstract class java.security.spec.EncodedKeySpec
	extends java.lang.Object
	implements java.security.spec.KeySpec {

	// Constructors
	public EncodedKeySpec();

	// Instance Methods
	public abstract byte[] getEncoded();
	public abstract String getFormat();
}

See also: KeyFactory, KeySpec, PKCS8EncodedKeySpec, X509EncodedKeySpec

Interface java.security.spec.KeySpec

A key specification is used to import and export keys via a key factory. This may be done either based upon the algorithm parameters used to generate the key or via an encoded series of bytes that represent the key. Classes that deal with the latter case implement this interface, which is used strictly for type identification.

Interface Definition

public abstract interface java.security.spec.KeySpec {
}

See also: AlgorithmParameterSpec, EncodedKeySpec, KeyFactory

Class java.security.spec.PKCS8EncodedKeySpec

This class represents the PKCS#8 encoding of a private key; the key is encoded in DER format. This is the class that is typically used when dealing with DSA private keys in a key factory.

Class Definition

public class java.security.spec.PKCS8EncodedKeySpec
	extends java.security.spec.EncodedKeySpec {

	// Constructors
	public PKCS8EncodedKeySpec(byte[]);

	// Instance Methods
	public byte[] getEncoded();
	public final String getFormat();
}

See also: EncodedKeySpec, X509EncodedKeySpec

Class java.security.spec.RSAPrivateKeySpec

This class represents a key specification for an RSA private key; this specification uses a modulus and a private exponent. Instances of this class may be used with an appropriate key factory to generate private keys. Use of this class requires a third-party security provider.

Class Definition

public java.security.spec.RSAPrivateKeySpec
	extends java.lang.Object
	implements java.security.spec.KeySpec {

	// Constructors
	public RSAPrivateKeySpec(BigInteger, BigInteger);

	// Instance Methods
	public BigInteger getModulus();
	public BigInteger getPrivateExponent();
}

See also: KeyFactory, KeySpec, PrivateKey

Class java.security.spec.RSAPublicKeySpec

This class represents a key specification for an RSA public key. Instances of this class may be used with an appropriate key factory to generate public keys. Use of this class requires a third-party security provider.

Class Definition

public java.security.spec.RSAPublicKeySpec
	extends java.lang.Object
	implements java.security.spec.KeySpec {

	// Constructors
	public RSAPublicKeySpec(BigInteger, BigInteger);

	// Instance Methods
	public BigInteger getModulus();
	public BigInteger getPublicExponent();
}

See also: KeyFactory, KeySpec, PublicKey

Class java.security.spec.X509EncodedKeySpec

This class represents the X509 encoding of a public key. It may also be used for private keys, although the PKCS#8 encoding is typically used for those keys.

Class Definition

public class java.security.spec.X509EncodedKeySpec
	extends java.security.spec.EncodedKeySpec {

	// Constructors
	public X509EncodedKeySpec(byte[]);

	// Instance Methods
	public byte[] getEncoded();
	public final String getFormat();
}

See also: EncodedKeySpec, PKCS8EncodedKeySpec



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.