public class AS400CertificateUserProfileUtil extends AS400CertificateUtil implements java.io.Serializable
The AS400CertificateUserProfileUtil class accesses certificates in an IBM i user profile object.
DEFAULT_BUFFER_SIZE, MAX_BUFFER_SIZE, MIN_BUFFER_SIZE
Constructor and Description |
---|
AS400CertificateUserProfileUtil()
Constructs an AS400CertificateUserProfileUtil object.
|
AS400CertificateUserProfileUtil(AS400 system,
java.lang.String path)
Constructs an AS400CertificateUserProfileUtil object.
|
Modifier and Type | Method and Description |
---|---|
void |
addCertificate(byte[] certificate)
Adds the certificate to the user profile.
|
void |
deleteCertificate(byte[] certificate)
Deletes the certificate from the user profile.
|
void |
deleteCertificateByHandle(byte[] certificateHandle)
Deletes the certificate matching the certificate handle from the user profile.
|
java.lang.String |
findCertificateUser(byte[] certificate)
Returns the user profile name which contains the certificate.
|
java.lang.String |
findCertificateUserByHandle(byte[] certificateHandle)
Returns the user profile which contains the certificate with the specified handle.
|
int |
listCertificates(AS400CertificateAttribute[] certificateAttributes,
java.lang.String userSpaceName)
List certificates which match the specified attributes.
|
void |
setPath(java.lang.String path)
Sets the path for the user profile.
|
addAS400CertificateListener, addPropertyChangeListener, addVetoableChangeListener, getCertificateHandle, getCertificates, getFirstCertificates, getName, getNextCertificates, getObjectInfo, getPath, getSystem, removeAS400CertificateListener, removePropertyChangeListener, removeVetoableChangeListener, setObjectInfo, setSystem
public AS400CertificateUserProfileUtil()
public AS400CertificateUserProfileUtil(AS400 system, java.lang.String path)
system
- The system on which the user profile exists.path
- The fully qualified integrated file system path name of the user profile, for example, "/QSYS.LIB/MYLIB.LIB/MYUSRPRF.USRPRF".public void addCertificate(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
addCertificate
in class AS400CertificateUtil
certificate
- The complete ASN.1 X.509 certificate to be added to the user profile.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate.ExtendedIOException
- If certificate already added and other IBM i certificate access errors.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public void deleteCertificate(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
deleteCertificate
in class AS400CertificateUtil
certificate
- The complete ASN.1 X.509 certificate to be deleted from the user profile.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate.ExtendedIOException
- If certificate not found and other IBM i certificate access errors.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public void deleteCertificateByHandle(byte[] certificateHandle) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
deleteCertificateByHandle
in class AS400CertificateUtil
certificateHandle
- The AS400Certificate handle of the certificate to be deleted from the user profile.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate handle.ExtendedIOException
- If certificate not found and other IBM i certificate access errors.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public java.lang.String findCertificateUser(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
certificate
- The ASN.1 X.509 encoded certificate to search for in the user profile.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate.ExtendedIOException
- If certificate not found and other IBM i certificate access errors.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public java.lang.String findCertificateUserByHandle(byte[] certificateHandle) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
certificateHandle
- The AS400Certificate handle the certificate should match.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate handle.ExtendedIOException
- If certificate not found and other IBM i certificate access errors.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public int listCertificates(AS400CertificateAttribute[] certificateAttributes, java.lang.String userSpaceName) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
listCertificates
in class AS400CertificateUtil
certificateAttributes
- The list of attributes the certificate should match.
A value of null places all certificates from user profile into the user space.
An empty String or empty byte array search attribute will search for certificates that do not have this attribute.
For example, SUBJECT_ORGANIZATION = new String("") will search for certificates without the subject organization field.
Null search attributes are ignored.userSpaceName
- The fully qualified integrated file system path name of the user space to put the list results, for example, /QSYS.LIB/MYLIB.LIB/MYUSRSPC.USRSPC. The 10 character IBM i library of the user space may also be specified as %CURLIB% or %LIBL%.
See QSYSObjectPathName
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid search attributes or input parameter.ExtendedIOException
- If IBM i certificate access error.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the IBM i object does not exist.public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
setPath
in class AS400CertificateUtil
path
- The fully qualified integrated file system path name of the user profile.java.beans.PropertyVetoException
- If the change is vetoed.