Interface CUserService
-
- All Known Implementing Classes:
CUserServiceImpl
public interface CUserService
High-level user certificate and keystore operations. These services help retrieving certificates, keystores and other information related to specific users.- Author:
- Wojciech Sulejman
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentModel
createCertificate(DocumentModel user, String userKeyPassword)
Generates user certificate and user keys, saves them to a user store, and persists the store in the directory.void
deleteCertificate(String userID)
Deletes user entry from the certificate directory.DocumentModel
getCertificate(String userID)
Retrieves a user certificate from the directory.byte[]
getRootCertificateData()
Retrieves the public root certificate.String
getUserCertInfo(DocumentModel user, String userKeyPassword)
Returns simplified textual representation of a certificate's contents.UserInfo
getUserInfo(DocumentModel userModel)
Retrieves a UserInfo object containing information needed for certificate generation.KeyStore
getUserKeystore(String userID, String userKeyPassword)
Retrieves user keystore from the directory.boolean
hasCertificate(String userID)
Checks if the user is present in the certificate directory.
-
-
-
Method Detail
-
createCertificate
DocumentModel createCertificate(DocumentModel user, String userKeyPassword) throws CertException
Generates user certificate and user keys, saves them to a user store, and persists the store in the directory.- Throws:
CertException
-
getUserInfo
UserInfo getUserInfo(DocumentModel userModel) throws CertException
Retrieves a UserInfo object containing information needed for certificate generation.- Throws:
CertException
-
getUserCertInfo
String getUserCertInfo(DocumentModel user, String userKeyPassword) throws CertException
Returns simplified textual representation of a certificate's contents.- Returns:
- Simple certificate string.
- Throws:
CertException
-
getUserKeystore
KeyStore getUserKeystore(String userID, String userKeyPassword) throws CertException
Retrieves user keystore from the directory.- Returns:
- User KeyStore object
- Throws:
CertException
-
getCertificate
DocumentModel getCertificate(String userID)
Retrieves a user certificate from the directory.- Returns:
- certificate document model
-
getRootCertificateData
byte[] getRootCertificateData()
Retrieves the public root certificate.- Returns:
- certificate document model
-
hasCertificate
boolean hasCertificate(String userID) throws CertException
Checks if the user is present in the certificate directory.- Throws:
CertException
-
deleteCertificate
void deleteCertificate(String userID) throws CertException
Deletes user entry from the certificate directory.This is a high-level operation. The following containers/entries are removed:
- a certificate directory entry related to the userID
- a keystore (which was saved as a field in the directory entry)
- a private key and a public certificate (which were contained in the keystore)
- Throws:
CertException
-
-