< prev index next >

src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java

Print this page




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.security.auth.x500;
  27 
  28 import java.security.PrivateKey;
  29 import java.security.cert.X509Certificate;
  30 import javax.security.auth.Destroyable;
  31 
  32 /**
  33  * <p> This class represents an {@code X500PrivateCredential}.
  34  * It associates an X.509 certificate, corresponding private key and the
  35  * KeyStore alias used to reference that exact key pair in the KeyStore.
  36  * This enables looking up the private credentials for an X.500 principal
  37  * in a subject.
  38  *

  39  */
  40 public final class X500PrivateCredential implements Destroyable {
  41     private X509Certificate cert;
  42     private PrivateKey key;
  43     private String alias;
  44 
  45     /**
  46      * Creates an X500PrivateCredential that associates an X.509 certificate,
  47      * a private key and the KeyStore alias.
  48      *
  49      * @param cert X509Certificate
  50      * @param key  PrivateKey for the certificate
  51      * @exception IllegalArgumentException if either {@code cert} or
  52      * {@code key} is null
  53      *
  54      */
  55 
  56     public X500PrivateCredential(X509Certificate cert, PrivateKey key) {
  57         if (cert == null || key == null )
  58             throw new IllegalArgumentException();




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.security.auth.x500;
  27 
  28 import java.security.PrivateKey;
  29 import java.security.cert.X509Certificate;
  30 import javax.security.auth.Destroyable;
  31 
  32 /**
  33  * <p> This class represents an {@code X500PrivateCredential}.
  34  * It associates an X.509 certificate, corresponding private key and the
  35  * KeyStore alias used to reference that exact key pair in the KeyStore.
  36  * This enables looking up the private credentials for an X.500 principal
  37  * in a subject.
  38  *
  39  * @since 1.4
  40  */
  41 public final class X500PrivateCredential implements Destroyable {
  42     private X509Certificate cert;
  43     private PrivateKey key;
  44     private String alias;
  45 
  46     /**
  47      * Creates an X500PrivateCredential that associates an X.509 certificate,
  48      * a private key and the KeyStore alias.
  49      *
  50      * @param cert X509Certificate
  51      * @param key  PrivateKey for the certificate
  52      * @exception IllegalArgumentException if either {@code cert} or
  53      * {@code key} is null
  54      *
  55      */
  56 
  57     public X500PrivateCredential(X509Certificate cert, PrivateKey key) {
  58         if (cert == null || key == null )
  59             throw new IllegalArgumentException();


< prev index next >