/************************************************************************* * * * EJBCA Community: The OpenSource Certificate Authority * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.ejbca.core.protocol.acme; import java.util.List; import java.util.Set; import javax.ejb.Local; import org.cesecore.authentication.tokens.AuthenticationToken; import org.cesecore.authorization.AuthorizationDeniedException; import org.cesecore.certificates.ca.CADoesntExistsException; import org.cesecore.certificates.ca.CAInfo; import org.cesecore.certificates.certificate.CertificateDataWrapper; import org.cesecore.certificates.certificateprofile.CertificateProfile; import org.cesecore.certificates.endentity.EndEntityInformation; import org.ejbca.core.EjbcaException; import org.ejbca.core.model.approval.ApprovalException; import org.ejbca.core.model.approval.WaitingForApprovalException; import org.ejbca.core.model.era.IdNameHashMap; import org.ejbca.core.model.ra.raadmin.EndEntityProfile; /** * Proxy for identifying all calls that are needed in the RaMasterApi to fully support ACME. * * * @version $Id: AcmeRaMasterApiSessionLocal.java 29784 2018-08-30 08:20:30Z tarmo_r_helmes $ */ @Local public interface AcmeRaMasterApiSessionLocal { /** @see org.ejbca.core.model.era.RaMasterApi#changeCertificateStatus(AuthenticationToken, String, int, int) */ boolean changeCertificateStatus(AuthenticationToken authenticationToken, String fingerprint, int newStatus, int revocationReason) throws ApprovalException, WaitingForApprovalException; /** @see org.ejbca.core.model.era.RaMasterApi#searchForCertificate(AuthenticationToken, String) */ CertificateDataWrapper searchForCertificate(AuthenticationToken authenticationToken, String fingerprint); /** @see org.ejbca.core.protocol.acme.AcmeAccountDataSessionBean#getAcmeAccount(String) */ AcmeAccount getAcmeAccount(String accountId); /** @see org.ejbca.core.protocol.acme.AcmeAccountDataSessionBean#getAcmeAccountByPublicKeyStorageId(String) */ AcmeAccount getAcmeAccountByPublicKeyStorageId(String publicKeyStorageId); /** @see org.ejbca.core.protocol.acme.AcmeAccountDataSessionBean#createOrUpdate(AcmeAccount) */ String persistAcmeAccountData(AcmeAccount acmeAccount); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#getAcmeOrderById(String) */ AcmeOrder getAcmeOrder(String orderId); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#getAcmeOrdersByAccountId(String) */ Set getAcmeOrdersByAccountId(String accountId); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#getFinalizedAcmeOrdersByFingerprint(String) */ Set getFinalizedAcmeOrdersByFingerprint(String fingerprint); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#persist(AcmeOrder) */ String persistAcmeOrderData(AcmeOrder acmeOrder); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#persist(List) */ List persistAcmeOrderData(List acmeOrders); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#remove(String) */ void removeAcmeOrder(String orderId); /** @see org.ejbca.ui.web.protocol.acme.storage.AcmeOrderDataSessionBean#removeAll(List) */ void removeAcmeOrders(List orderId); /** @see org.ejbca.core.protocol.acme.AcmeAuthorizationDataSessionBean#getAcmeAuthorization(String) */ AcmeAuthorization getAcmeAuthorizationById(String authorizationId); /** @see org.ejbca.core.protocol.acme.AcmeAuthorizationDataSessionBean#getAcmeAuthorizationsByOrderId(String) */ List getAcmeAuthorizationsByOrderId(String orderId); /** @see org.ejbca.core.protocol.acme.AcmeAuthorizationDataSessionBean#getAcmeAuthorizationsByAccountId(String) */ List getAcmeAuthorizationsByAccountId(String accountId); /** @see org.ejbca.core.protocol.acme.AcmeAuthorizationDataSessionBean#createOrUpdate(AcmeAuthorization) */ String persistAcmeAuthorizationData(AcmeAuthorization acmeAuthorization); /** @see org.ejbca.core.protocol.acme.AcmeAuthorizationDataSessionBean#createOrUpdateList(List) */ void persistAcmeAuthorizationDataList(List acmeAuthorizations); /** @see org.ejbca.core.protocol.acme.AcmeChallengeDataSessionBean#getAcmeChallenge(String) */ AcmeChallenge getAcmeChallengeById (final String challengeId); /** @see org.ejbca.core.protocol.acme.AcmeChallengeDataSessionBean#getAcmeChallengesByAuthorizationId(String) */ List getAcmeChallengesByAuthorizationId (final String authorizationId); /** @see org.ejbca.core.protocol.acme.AcmeChallengeDataSessionBean#createOrUpdate(AcmeChallenge) */ void persistAcmeChallengeData(AcmeChallenge acmeChallenge); /** @see org.ejbca.core.protocol.acme.AcmeChallengeDataSessionBean#createOrUpdateList(List)*/ void persistAcmeChallengeDataList(List acmeChallenges); /** @see org.ejbca.core.protocol.acme.AcmeNonceDataSessionBean#useNonce(String, long, long) */ boolean useAcmeReplayNonce(String nonce, long timeCreated, long timeExpires); /** @see org.ejbca.core.model.era.RaMasterApi#getAuthorizedEndEntityProfiles(AuthenticationToken, String) */ IdNameHashMap getAuthorizedEndEntityProfiles(AuthenticationToken authenticationToken, String endEntityAccessRule); /** @see org.ejbca.core.model.era.RaMasterApi#getAuthorizedCertificateProfiles(AuthenticationToken) */ IdNameHashMap getAuthorizedCertificateProfiles(AuthenticationToken authenticationToken); /** @see org.ejbca.core.model.era.RaMasterApi#getAuthorizedCAInfos(AuthenticationToken) */ IdNameHashMap getAuthorizedCAInfos(AuthenticationToken authenticationToken); /** @see org.ejbca.core.model.era.RaMasterApi#searchUser(AuthenticationToken, String) */ EndEntityInformation searchUser(AuthenticationToken authenticationToken, String username); /** @see org.ejbca.core.model.era.RaMasterApi#addUser(AuthenticationToken, EndEntityInformation, boolean) */ void addUser(AuthenticationToken authenticationToken, EndEntityInformation endEntityInformation, boolean clearpwd) throws AuthorizationDeniedException, EjbcaException, WaitingForApprovalException; /** @see org.ejbca.core.model.era.RaMasterApi#createCertificate(AuthenticationToken, EndEntityInformation) */ byte[] createCertificate(AuthenticationToken authenticationToken, EndEntityInformation endEntityInformation) throws AuthorizationDeniedException, EjbcaException; /** @see org.ejbca.core.model.era.RaMasterApi#getCaaIdentities(AuthenticationToken, int) */ Set getCaaIdentities(AuthenticationToken authenticationToken, int caId) throws CADoesntExistsException, AuthorizationDeniedException; boolean isPeerAuthorizedAcme(); }