src/share/classes/java/security/AlgorithmParameters.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 30,61 ****
import java.security.spec.InvalidParameterSpecException;
/**
* This class is used as an opaque representation of cryptographic parameters.
*
! * <p>An <code>AlgorithmParameters</code> object for managing the parameters
* for a particular algorithm can be obtained by
! * calling one of the <code>getInstance</code> factory methods
* (static methods that return instances of a given class).
*
! * <p>Once an <code>AlgorithmParameters</code> object is obtained, it must be
! * initialized via a call to <code>init</code>, using an appropriate parameter
* specification or parameter encoding.
*
* <p>A transparent parameter specification is obtained from an
! * <code>AlgorithmParameters</code> object via a call to
! * <code>getParameterSpec</code>, and a byte encoding of the parameters is
! * obtained via a call to <code>getEncoded</code>.
*
* <p> Every implementation of the Java platform is required to support the
! * following standard <code>AlgorithmParameters</code> algorithms:
* <ul>
! * <li><tt>AES</tt></li>
! * <li><tt>DES</tt></li>
! * <li><tt>DESede</tt></li>
! * <li><tt>DiffieHellman</tt></li>
! * <li><tt>DSA</tt></li>
* </ul>
* These algorithms are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
* AlgorithmParameters section</a> of the
* Java Cryptography Architecture Standard Algorithm Name Documentation.
--- 30,61 ----
import java.security.spec.InvalidParameterSpecException;
/**
* This class is used as an opaque representation of cryptographic parameters.
*
! * <p>An {@code AlgorithmParameters} object for managing the parameters
* for a particular algorithm can be obtained by
! * calling one of the {@code getInstance} factory methods
* (static methods that return instances of a given class).
*
! * <p>Once an {@code AlgorithmParameters} object is obtained, it must be
! * initialized via a call to {@code init}, using an appropriate parameter
* specification or parameter encoding.
*
* <p>A transparent parameter specification is obtained from an
! * {@code AlgorithmParameters} object via a call to
! * {@code getParameterSpec}, and a byte encoding of the parameters is
! * obtained via a call to {@code getEncoded}.
*
* <p> Every implementation of the Java platform is required to support the
! * following standard {@code AlgorithmParameters} algorithms:
* <ul>
! * <li>{@code AES}</li>
! * <li>{@code DES}</li>
! * <li>{@code DESede}</li>
! * <li>{@code DiffieHellman}</li>
! * <li>{@code DSA}</li>
* </ul>
* These algorithms are described in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
* AlgorithmParameters section</a> of the
* Java Cryptography Architecture Standard Algorithm Name Documentation.
*** 121,131 ****
*
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p> The returned parameter object must be initialized via a call to
! * <code>init</code>, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
--- 121,131 ----
*
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p> The returned parameter object must be initialized via a call to
! * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
*** 163,173 ****
*
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p>The returned parameter object must be initialized via a call to
! * <code>init</code>, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
--- 163,173 ----
*
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p>The returned parameter object must be initialized via a call to
! * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
*** 210,220 ****
* AlgorithmParametersSpi implementation from the specified Provider
* object is returned. Note that the specified Provider object
* does not have to be registered in the provider list.
*
* <p>The returned parameter object must be initialized via a call to
! * <code>init</code>, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
--- 210,220 ----
* AlgorithmParametersSpi implementation from the specified Provider
* object is returned. Note that the specified Provider object
* does not have to be registered in the provider list.
*
* <p>The returned parameter object must be initialized via a call to
! * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
* See the AlgorithmParameters section in the <a href=
* "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
*** 257,267 ****
return this.provider;
}
/**
* Initializes this parameter object using the parameters
! * specified in <code>paramSpec</code>.
*
* @param paramSpec the parameter specification.
*
* @exception InvalidParameterSpecException if the given parameter
* specification is inappropriate for the initialization of this parameter
--- 257,267 ----
return this.provider;
}
/**
* Initializes this parameter object using the parameters
! * specified in {@code paramSpec}.
*
* @param paramSpec the parameter specification.
*
* @exception InvalidParameterSpecException if the given parameter
* specification is inappropriate for the initialization of this parameter
*** 293,305 ****
paramSpi.engineInit(params);
this.initialized = true;
}
/**
! * Imports the parameters from <code>params</code> and decodes them
* according to the specified decoding scheme.
! * If <code>format</code> is null, the
* primary decoding format for parameters is used. The primary decoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
*
* @param params the encoded parameters.
--- 293,305 ----
paramSpi.engineInit(params);
this.initialized = true;
}
/**
! * Imports the parameters from {@code params} and decodes them
* according to the specified decoding scheme.
! * If {@code format} is null, the
* primary decoding format for parameters is used. The primary decoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
*
* @param params the encoded parameters.
*** 316,330 ****
this.initialized = true;
}
/**
* Returns a (transparent) specification of this parameter object.
! * <code>paramSpec</code> identifies the specification class in which
* the parameters should be returned. It could, for example, be
! * <code>DSAParameterSpec.class</code>, to indicate that the
* parameters should be returned in an instance of the
! * <code>DSAParameterSpec</code> class.
*
* @param paramSpec the specification class in which
* the parameters should be returned.
*
* @return the parameter specification.
--- 316,330 ----
this.initialized = true;
}
/**
* Returns a (transparent) specification of this parameter object.
! * {@code paramSpec} identifies the specification class in which
* the parameters should be returned. It could, for example, be
! * {@code DSAParameterSpec.class}, to indicate that the
* parameters should be returned in an instance of the
! * {@code DSAParameterSpec} class.
*
* @param paramSpec the specification class in which
* the parameters should be returned.
*
* @return the parameter specification.
*** 361,371 ****
return paramSpi.engineGetEncoded();
}
/**
* Returns the parameters encoded in the specified scheme.
! * If <code>format</code> is null, the
* primary encoding format for parameters is used. The primary encoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
*
* @param format the name of the encoding format.
--- 361,371 ----
return paramSpi.engineGetEncoded();
}
/**
* Returns the parameters encoded in the specified scheme.
! * If {@code format} is null, the
* primary encoding format for parameters is used. The primary encoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
*
* @param format the name of the encoding format.