Class KeymanagerController
- java.lang.Object
-
- io.mosip.kernel.keymanagerservice.controller.KeymanagerController
-
@CrossOrigin @RestController public class KeymanagerController extends Object
This class provides controller methods for Key manager.- Since:
- 1.0.0
- Author:
- Dharmesh Khandelwal, Urvil Joshi
-
-
Constructor Summary
Constructors Constructor Description KeymanagerController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto>generateCSR(@Valid io.mosip.kernel.core.http.RequestWrapper<CSRGenerateRequestDto> csrGenRequestDto)Request to Generate CSR for the provided APP ID & REF ID along with other certificate params.io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto>generateMasterKey(String objectType, @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> keyPairGenRequestDto)Generate Master Key for the provided APP ID.io.mosip.kernel.core.http.ResponseWrapper<SymmetricKeyGenerateResponseDto>generateSymmetricKey(@Valid io.mosip.kernel.core.http.RequestWrapper<SymmetricKeyGenerateRequestDto> symGenRequestDto)Request to Generate Symmetric key for the provided APP ID & REF ID.io.mosip.kernel.core.http.ResponseWrapper<AllCertificatesDataResponseDto>getAllCertificates(String applicationId, Optional<String> referenceId)Request to get all the Certificates for the Provided APP ID & REF ID.io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto>getCertificate(String applicationId, Optional<String> referenceId)Request to get Certificate for the Provided APP ID & REF ID.io.mosip.kernel.core.http.ResponseWrapper<RevokeKeyResponseDto>revokeKey(@Valid io.mosip.kernel.core.http.RequestWrapper<RevokeKeyRequestDto> revokeKeyRequestDto)Request to Revoke Base Key for the provided APP ID & REF ID.io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto>uploadCertificate(@Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto)Update signed certificate for the provided APP ID & REF ID.io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto>uploadOtherDomainCertificate(@Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto)Update signed certificate for the provided APP ID & REF ID for other domains.
-
-
-
Method Detail
-
generateMasterKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratemasterkeyobjecttype())") @ResponseFilter @PostMapping("/generateMasterKey/{objectType}") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateMasterKey(@PathVariable("objectType") String objectType, @RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> keyPairGenRequestDto)Generate Master Key for the provided APP ID.- Parameters:
objectType- response Object Type. Support types are Certificate/CSR. Path Parameter.keyPairGenRequestDto-KeyPairGenerateRequestDtorequest- Returns:
KeyPairGenerateResponseDtoinstance
-
getCertificate
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getGetgetcertificate())") @ResponseFilter @GetMapping("/getCertificate") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> getCertificate(@RequestParam("applicationId") String applicationId, @RequestParam("referenceId") Optional<String> referenceId)Request to get Certificate for the Provided APP ID & REF ID.- Parameters:
applicationId- Application id of the application requesting CertificatereferenceId- Reference id of the application requesting Certificate. Blank in case of Master Key.- Returns:
KeyPairGenerateResponseDtoinstance
-
generateCSR
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratecsr())") @ResponseFilter @PostMapping("/generateCSR") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateCSR(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<CSRGenerateRequestDto> csrGenRequestDto)Request to Generate CSR for the provided APP ID & REF ID along with other certificate params.- Parameters:
csrGenRequestDto-CSRGenerateRequestDtorequest- Returns:
KeyPairGenerateResponseDtoinstance
-
uploadCertificate
@ResponseFilter @PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostuploadcertificate())") @PostMapping("/uploadCertificate") public io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadCertificate(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto)Update signed certificate for the provided APP ID & REF ID.- Parameters:
uploadCertRequestDto-UploadCertificateRequestDtorequest- Returns:
UploadCertificateResponseDtoinstance
-
uploadOtherDomainCertificate
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostuploadotherdomaincertificate())") @ResponseFilter @PostMapping("/uploadOtherDomainCertificate") public io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadOtherDomainCertificate(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto)Update signed certificate for the provided APP ID & REF ID for other domains.- Parameters:
uploadCertRequestDto-UploadCertificateRequestDtorequest- Returns:
UploadCertificateResponseDtoinstance
-
generateSymmetricKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratesymmetrickey())") @ResponseFilter @PostMapping("/generateSymmetricKey") public io.mosip.kernel.core.http.ResponseWrapper<SymmetricKeyGenerateResponseDto> generateSymmetricKey(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<SymmetricKeyGenerateRequestDto> symGenRequestDto)Request to Generate Symmetric key for the provided APP ID & REF ID.- Parameters:
symGenRequestDto-SymmetricKeyGenerateRequestDtorequest- Returns:
SymmetricKeyGenerateResponseDtoinstance
-
revokeKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPutrevokekey())") @ResponseFilter @PutMapping("/revokeKey") public io.mosip.kernel.core.http.ResponseWrapper<RevokeKeyResponseDto> revokeKey(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<RevokeKeyRequestDto> revokeKeyRequestDto)Request to Revoke Base Key for the provided APP ID & REF ID.- Parameters:
revokeKeyRequestDto-RevokeKeyRequestDtorequest- Returns:
RevokeKeyResponseDtoinstance
-
getAllCertificates
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getGetgetcertificate())") @ResponseFilter @GetMapping("/getAllCertificates") public io.mosip.kernel.core.http.ResponseWrapper<AllCertificatesDataResponseDto> getAllCertificates(@RequestParam("applicationId") String applicationId, @RequestParam("referenceId") Optional<String> referenceId)Request to get all the Certificates for the Provided APP ID & REF ID.- Parameters:
applicationId- Application id of the application requesting CertificatereferenceId- Reference id of the application requesting Certificate. Blank in case of Master Key.- Returns:
KeyPairGenerateResponseDtoinstance
-
-