com.ibm.as400.access
Class AS400CertificateVldlUtil
- java.lang.Object
-
- com.ibm.as400.access.AS400CertificateUtil
-
- com.ibm.as400.access.AS400CertificateVldlUtil
-
- All Implemented Interfaces:
- java.io.Serializable
public class AS400CertificateVldlUtil extends AS400CertificateUtil implements java.io.Serializable
The AS400CertificateVldlUtil class provides the implementation of the methods for accessing certificates in an IBM i validation list object.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.ibm.as400.access.AS400CertificateUtil
DEFAULT_BUFFER_SIZE, MAX_BUFFER_SIZE, MIN_BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description AS400CertificateVldlUtil()
Constructs an AS400CertificateVldlUtil object.AS400CertificateVldlUtil(AS400 system, java.lang.String path)
Constructs an AS400CertificateVldlUtil object.
-
Method Summary
Methods Modifier and Type Method and Description void
addCertificate(byte[] certificate)
Add the certificate to the repository.boolean
checkCertificate(byte[] certificate)
Determines if the certificate is in the validation list.boolean
checkCertificateByHandle(byte[] certificateHandle)
Determines if a certificate matching the handle exists in the validation list.void
deleteCertificate(byte[] certificate)
Deletes the certificate from the validation list.void
deleteCertificateByHandle(byte[] certificateHandle)
Deletes the certificate matching the certificate handle from the validation list.int
listCertificates(AS400CertificateAttribute[] certificateAttributes, java.lang.String userSpaceName)
Lists certificates which match the specified attributes are copied from the validation list into the specified user space.void
setPath(java.lang.String path)
Sets the path for the validation list.-
Methods inherited from class com.ibm.as400.access.AS400CertificateUtil
addAS400CertificateListener, addPropertyChangeListener, addVetoableChangeListener, getCertificateHandle, getCertificates, getFirstCertificates, getName, getNextCertificates, getObjectInfo, getPath, getSystem, removeAS400CertificateListener, removePropertyChangeListener, removeVetoableChangeListener, setObjectInfo, setSystem
-
-
-
-
Constructor Detail
-
AS400CertificateVldlUtil
public AS400CertificateVldlUtil()
Constructs an AS400CertificateVldlUtil object.
-
AS400CertificateVldlUtil
public AS400CertificateVldlUtil(AS400 system, java.lang.String path)
Constructs an AS400CertificateVldlUtil object.- Parameters:
system
- The system on which the validation list exists.path
- The fully qualified integrated file system path name of the validation list. For example, /QSYS.LIB/MYLIB.LIB/MYVLDL.VLDL.
-
-
Method Detail
-
addCertificate
public void addCertificate(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Add the certificate to the repository. Throws an ExtendedIOException if the certificate is already a member of the repository.- Specified by:
addCertificate
in classAS400CertificateUtil
- Parameters:
certificate
- The complete ASN.1 X.509 certificate to be added to the validation list.- Throws:
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.
-
checkCertificate
public boolean checkCertificate(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Determines if the certificate is in the validation list.- Parameters:
certificate
- The ASN.1 encoded X.509 certificate to search for in the validation list.- Returns:
- true if the certificate is found in the validation list; false otherwise.
- Throws:
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.ExtendedIllegalArgumentException
- If invalid certificate.ExtendedIOException
- If 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.
-
checkCertificateByHandle
public boolean checkCertificateByHandle(byte[] certificateHandle) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Determines if a certificate matching the handle exists in the validation list.- Parameters:
certificateHandle
- The IBM i certificate handle matching the certificate.- Returns:
- true if a certificate matching the handle is found in the validation list; false otherwise.
- Throws:
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 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.
-
deleteCertificate
public void deleteCertificate(byte[] certificate) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Deletes the certificate from the validation list. Throws an ExtendedIOException if the certificate is not present in the validation list.- Specified by:
deleteCertificate
in classAS400CertificateUtil
- Parameters:
certificate
- The complete ASN.1 X.509 Certificate to be deleted from the repository.- Throws:
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.
-
deleteCertificateByHandle
public void deleteCertificateByHandle(byte[] certificateHandle) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Deletes the certificate matching the certificate handle from the validation list. Throws ExtendedIOException if the certificate is not present in the repository.- Specified by:
deleteCertificateByHandle
in classAS400CertificateUtil
- Parameters:
certificateHandle
- The IBM i certificate handle matching the certificate to be deleted from the repository.- Throws:
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.
-
listCertificates
public int listCertificates(AS400CertificateAttribute[] certificateAttributes, java.lang.String userSpaceName) throws AS400SecurityException, ErrorCompletingRequestException, ExtendedIOException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Lists certificates which match the specified attributes are copied from the validation list into the specified user space. The validation list is not locked during the listCertificates operation. Certificates are stored into the user space with CERT0100 format. See the IBM i QsyListVldlCertificates (QSYLSTVC) and QsyListUserCertificates (QSYLSTUC) API's for further information.- Specified by:
listCertificates
in classAS400CertificateUtil
- Parameters:
certificateAttributes
- The list of attributes the certificate should match. A value of null places all certificates from the validation list 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 char IBM i library of the user space may also be specified as %CURLIB% or %LIBL%. SeeQSYSObjectPathName
- Returns:
- The number of certificates found.
- Throws:
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.
-
setPath
public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
Sets the path for the validation list.- Specified by:
setPath
in classAS400CertificateUtil
- Parameters:
path
- The fully qualified integrated file system path name of the validation list.- Throws:
java.beans.PropertyVetoException
- If the change is vetoed.
-
-