Class IdentityService
- java.lang.Object
-
- fr.gouv.vitam.security.internal.rest.service.SecurityService
-
- fr.gouv.vitam.security.internal.rest.service.IdentityService
-
public class IdentityService extends SecurityService
manage certificate.
-
-
Constructor Summary
Constructors Constructor Description IdentityService(IdentityRepository identityRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contextIsUsed(java.lang.String contextId)
void
createIdentity(IdentityInsertModel identityInsertModel)
create certificatejava.util.List<IdentityModel>
findAllIdentities()
java.util.Optional<IdentityModel>
findIdentity(byte[] certificate)
CertificateRepository
getRepository()
java.util.Optional<IdentityModel>
linkContextToIdentity(IdentityInsertModel identityInsertModel)
-
Methods inherited from class fr.gouv.vitam.security.internal.rest.service.SecurityService
checkCertificates
-
-
-
-
Constructor Detail
-
IdentityService
public IdentityService(IdentityRepository identityRepository)
-
-
Method Detail
-
createIdentity
public void createIdentity(IdentityInsertModel identityInsertModel) throws java.security.cert.CertificateException, InvalidParseOperationException
create certificate- Parameters:
identityInsertModel
- Identity certificate to insert- Throws:
java.security.cert.CertificateException
- thrown if certificate parse failInvalidParseOperationException
- thrown if insertion fail
-
linkContextToIdentity
public java.util.Optional<IdentityModel> linkContextToIdentity(IdentityInsertModel identityInsertModel) throws java.security.cert.CertificateException, InvalidParseOperationException
- Parameters:
identityInsertModel
- Identity certificate to insert- Returns:
- the identity model if exists
- Throws:
java.security.cert.CertificateException
- thrown if certificate parse failInvalidParseOperationException
- thrown retrieving identity fail
-
findIdentity
public java.util.Optional<IdentityModel> findIdentity(byte[] certificate) throws java.security.cert.CertificateException, InvalidParseOperationException
- Parameters:
certificate
- the certificate to find- Returns:
- the identity model if exists
- Throws:
java.security.cert.CertificateException
- thrown if certificate parse failInvalidParseOperationException
- thrown retrieving certificate fail
-
findAllIdentities
public java.util.List<IdentityModel> findAllIdentities() throws InvalidParseOperationException
- Returns:
- list of identity models
- Throws:
InvalidParseOperationException
- thrown retrieving certificates fail
-
contextIsUsed
public boolean contextIsUsed(java.lang.String contextId)
- Parameters:
contextId
- the context Id- Returns:
- true if the context is used by an identity
-
getRepository
public CertificateRepository getRepository()
-
-