src/share/classes/java/security/Identity.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2006, 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) 1996, 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
*** 50,62 ****
* @see Signer
* @see Principal
*
* @author Benjamin Renaud
* @deprecated This class is no longer used. Its functionality has been
! * replaced by <code>java.security.KeyStore</code>, the
! * <code>java.security.cert</code> package, and
! * <code>java.security.Principal</code>.
*/
@Deprecated
public abstract class Identity implements Principal, Serializable {
/** use serialVersionUID from JDK 1.1.x for interoperability */
--- 50,62 ----
* @see Signer
* @see Principal
*
* @author Benjamin Renaud
* @deprecated This class is no longer used. Its functionality has been
! * replaced by {@code java.security.KeyStore}, the
! * {@code java.security.cert} package, and
! * {@code java.security.Principal}.
*/
@Deprecated
public abstract class Identity implements Principal, Serializable {
/** use serialVersionUID from JDK 1.1.x for interoperability */
*** 162,182 ****
/**
* Sets this identity's public key. The old key and all of this
* identity's certificates are removed by this operation.
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"setIdentityPublicKey"</code>
* as its argument to see if it's ok to set the public key.
*
* @param key the public key for this identity.
*
* @exception KeyManagementException if another identity in the
* identity's scope has the same public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* setting the public key.
*
* @see #getPublicKey
* @see SecurityManager#checkSecurityAccess
*/
--- 162,182 ----
/**
* Sets this identity's public key. The old key and all of this
* identity's certificates are removed by this operation.
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "setIdentityPublicKey"}
* as its argument to see if it's ok to set the public key.
*
* @param key the public key for this identity.
*
* @exception KeyManagementException if another identity in the
* identity's scope has the same public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* setting the public key.
*
* @see #getPublicKey
* @see SecurityManager#checkSecurityAccess
*/
*** 189,206 ****
}
/**
* Specifies a general information string for this identity.
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"setIdentityInfo"</code>
* as its argument to see if it's ok to specify the information string.
*
* @param info the information string.
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* setting the information string.
*
* @see #getInfo
* @see SecurityManager#checkSecurityAccess
*/
--- 189,206 ----
}
/**
* Specifies a general information string for this identity.
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "setIdentityInfo"}
* as its argument to see if it's ok to specify the information string.
*
* @param info the information string.
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* setting the information string.
*
* @see #getInfo
* @see SecurityManager#checkSecurityAccess
*/
*** 224,245 ****
* Adds a certificate for this identity. If the identity has a public
* key, the public key in the certificate must be the same, and if
* the identity does not have a public key, the identity's
* public key is set to be that specified in the certificate.
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"addIdentityCertificate"</code>
* as its argument to see if it's ok to add a certificate.
*
* @param certificate the certificate to be added.
*
* @exception KeyManagementException if the certificate is not valid,
* if the public key in the certificate being added conflicts with
* this identity's public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* adding a certificate.
*
* @see SecurityManager#checkSecurityAccess
*/
public void addCertificate(Certificate certificate)
--- 224,245 ----
* Adds a certificate for this identity. If the identity has a public
* key, the public key in the certificate must be the same, and if
* the identity does not have a public key, the identity's
* public key is set to be that specified in the certificate.
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "addIdentityCertificate"}
* as its argument to see if it's ok to add a certificate.
*
* @param certificate the certificate to be added.
*
* @exception KeyManagementException if the certificate is not valid,
* if the public key in the certificate being added conflicts with
* this identity's public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* adding a certificate.
*
* @see SecurityManager#checkSecurityAccess
*/
public void addCertificate(Certificate certificate)
*** 275,295 ****
/**
* Removes a certificate from this identity.
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"removeIdentityCertificate"</code>
* as its argument to see if it's ok to remove a certificate.
*
* @param certificate the certificate to be removed.
*
* @exception KeyManagementException if the certificate is
* missing, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* removing a certificate.
*
* @see SecurityManager#checkSecurityAccess
*/
public void removeCertificate(Certificate certificate)
--- 275,295 ----
/**
* Removes a certificate from this identity.
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "removeIdentityCertificate"}
* as its argument to see if it's ok to remove a certificate.
*
* @param certificate the certificate to be removed.
*
* @exception KeyManagementException if the certificate is
* missing, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* removing a certificate.
*
* @see SecurityManager#checkSecurityAccess
*/
public void removeCertificate(Certificate certificate)
*** 388,406 ****
/**
* Returns a short string describing this identity, telling its
* name and its scope (if any).
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"printIdentity"</code>
* as its argument to see if it's ok to return the string.
*
* @return information about this identity, such as its name and the
* name of its scope (if any).
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* returning a string describing this identity.
*
* @see SecurityManager#checkSecurityAccess
*/
public String toString() {
--- 388,406 ----
/**
* Returns a short string describing this identity, telling its
* name and its scope (if any).
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "printIdentity"}
* as its argument to see if it's ok to return the string.
*
* @return information about this identity, such as its name and the
* name of its scope (if any).
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* returning a string describing this identity.
*
* @see SecurityManager#checkSecurityAccess
*/
public String toString() {
*** 413,436 ****
}
/**
* Returns a string representation of this identity, with
* optionally more details than that provided by the
! * <code>toString</code> method without any arguments.
*
! * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
! * method is called with <code>"printIdentity"</code>
* as its argument to see if it's ok to return the string.
*
* @param detailed whether or not to provide detailed information.
*
! * @return information about this identity. If <code>detailed</code>
* is true, then this method returns more information than that
! * provided by the <code>toString</code> method without any arguments.
*
* @exception SecurityException if a security manager exists and its
! * <code>checkSecurityAccess</code> method doesn't allow
* returning a string describing this identity.
*
* @see #toString
* @see SecurityManager#checkSecurityAccess
*/
--- 413,436 ----
}
/**
* Returns a string representation of this identity, with
* optionally more details than that provided by the
! * {@code toString} method without any arguments.
*
! * <p>First, if there is a security manager, its {@code checkSecurityAccess}
! * method is called with {@code "printIdentity"}
* as its argument to see if it's ok to return the string.
*
* @param detailed whether or not to provide detailed information.
*
! * @return information about this identity. If {@code detailed}
* is true, then this method returns more information than that
! * provided by the {@code toString} method without any arguments.
*
* @exception SecurityException if a security manager exists and its
! * {@code checkSecurityAccess} method doesn't allow
* returning a string describing this identity.
*
* @see #toString
* @see SecurityManager#checkSecurityAccess
*/