Class CUserServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.signature.core.user.CUserServiceImpl
-
- All Implemented Interfaces:
CUserService
,Adaptable
,Component
,Extensible
,TimestampedService
public class CUserServiceImpl extends DefaultComponent implements CUserService
Base implementation of the user certificate service.- Author:
- Wojciech Sulejman
-
-
Field Summary
Fields Modifier and Type Field Description protected String
countryCode
Configurable country codeprotected String
organization
Configurable organization nameprotected String
organizationalUnit
Configurable organizational unit name-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description CUserServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.protected CertService
getCertService()
protected static DirectoryService
getDirectoryService()
byte[]
getRootCertificateData()
Retrieves the public root certificate.protected RootService
getRootService()
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 userKeystorePassword)
Retrieves user keystore from the directory.boolean
hasCertificate(String userID)
Checks if the user is present in the certificate directory.void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
countryCode
protected String countryCode
Configurable country code
-
organization
protected String organization
Configurable organization name
-
organizationalUnit
protected String organizationalUnit
Configurable organizational unit name
-
-
Constructor Detail
-
CUserServiceImpl
public CUserServiceImpl()
-
-
Method Detail
-
getUserInfo
public UserInfo getUserInfo(DocumentModel userModel) throws CertException
Description copied from interface:CUserService
Retrieves a UserInfo object containing information needed for certificate generation.- Specified by:
getUserInfo
in interfaceCUserService
- Throws:
CertException
-
getUserKeystore
public KeyStore getUserKeystore(String userID, String userKeystorePassword) throws CertException
Description copied from interface:CUserService
Retrieves user keystore from the directory.- Specified by:
getUserKeystore
in interfaceCUserService
- Returns:
- User KeyStore object
- Throws:
CertException
-
createCertificate
public DocumentModel createCertificate(DocumentModel user, String userKeyPassword) throws CertException
Description copied from interface:CUserService
Generates user certificate and user keys, saves them to a user store, and persists the store in the directory.- Specified by:
createCertificate
in interfaceCUserService
- Throws:
CertException
-
getDirectoryService
protected static DirectoryService getDirectoryService()
-
getUserCertInfo
public String getUserCertInfo(DocumentModel user, String userKeyPassword) throws CertException
Description copied from interface:CUserService
Returns simplified textual representation of a certificate's contents.- Specified by:
getUserCertInfo
in interfaceCUserService
- Returns:
- Simple certificate string.
- Throws:
CertException
-
getCertificate
public DocumentModel getCertificate(String userID)
Description copied from interface:CUserService
Retrieves a user certificate from the directory.- Specified by:
getCertificate
in interfaceCUserService
- Returns:
- certificate document model
-
getRootCertificateData
public byte[] getRootCertificateData()
Description copied from interface:CUserService
Retrieves the public root certificate.- Specified by:
getRootCertificateData
in interfaceCUserService
- Returns:
- certificate document model
-
hasCertificate
public boolean hasCertificate(String userID) throws CertException
Description copied from interface:CUserService
Checks if the user is present in the certificate directory.- Specified by:
hasCertificate
in interfaceCUserService
- Throws:
CertException
-
deleteCertificate
public void deleteCertificate(String userID) throws CertException
Description copied from interface:CUserService
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)
- Specified by:
deleteCertificate
in interfaceCUserService
- Throws:
CertException
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
getCertService
protected CertService getCertService()
-
getRootService
protected RootService getRootService()
-
-