Class IdentityService
- java.lang.Object
-
- fr.gouv.vitam.security.internal.rest.service.IdentityService
-
public class IdentityService extends java.lang.Object
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.Optional<IdentityModel>
findIdentity(byte[] certificate)
java.util.Optional<IdentityModel>
linkContextToIdentity(IdentityInsertModel identityInsertModel)
-
-
-
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
-
contextIsUsed
public boolean contextIsUsed(java.lang.String contextId)
- Parameters:
contextId
- the context Id- Returns:
- true if the context is used by an identity
-
-