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
Base implementation of the user certificate service.
- Author:
- Wojciech Sulejman
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Configurable country codeprotected String
Configurable organization nameprotected String
Configurable organizational unit nameFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateCertificate
(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.getCertificate
(String userID) Retrieves a user certificate from the directory.protected CertService
protected static DirectoryService
byte[]
Retrieves the public root certificate.protected RootService
getUserCertInfo
(DocumentModel user, String userKeyPassword) Returns simplified textual representation of a certificate's contents.getUserInfo
(DocumentModel userModel) Retrieves a UserInfo object containing information needed for certificate generation.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
getApplicationStartedOrder
-
Field Details
-
countryCode
Configurable country code -
organization
Configurable organization name -
organizationalUnit
Configurable organizational unit name
-
-
Constructor Details
-
CUserServiceImpl
public CUserServiceImpl()
-
-
Method Details
-
getUserInfo
Description copied from interface:CUserService
Retrieves a UserInfo object containing information needed for certificate generation.- Specified by:
getUserInfo
in interfaceCUserService
- Throws:
CertException
-
getUserKeystore
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
-
getUserCertInfo
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
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
Description copied from interface:CUserService
Checks if the user is present in the certificate directory.- Specified by:
hasCertificate
in interfaceCUserService
- Throws:
CertException
-
deleteCertificate
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
-
getRootService
-